Welcome Guest, Not a member yet? Register   Sign In
Email Problem
#1

[eluser]BenRob[/eluser]
Hi all I'm having a problem with email.

I've used this loads but I've just moved to rackspace and I'm having a problem.

If I use the PHP mail() function it works fine. but when I use the code below it doesn't work. It says the email has been sent using the debugger but nothing in my inbox. Any help would be much appreciated.

Quote:Your message has been successfully sent using the following protocol: sendmail

User-Agent: CodeIgniter
Date: Thu, 26 Nov 2009 15:59:20 +0000
From: "The Garden"
Return-Path:
To: [email protected]
Subject: Password Reset
Reply-To: "[email protected]"
X-Sender: [email protected]
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0


Content-Type: multipart/alternative; boundary="B_ALT_4b0ea5d842e0a"
This is a multi-part message in MIME format.
Your email application may not support this format.

--B_ALT_4b0ea5d842e0a
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Hi ,\n\nAs requested, your password has been reset. Here are your login
details :\n\nusername: \npassword: m6pk0db0\n\nOnce you have logged in you
can change your password to something that you find easier to
remember.\n\n


--B_ALT_4b0ea5d842e0a
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<p>Hi, </p><p>As requested, your password has been reset. Here are your log=
in details :<br />username: <br />password: m6pk0db0</p><p>Once you have lo=
gged in you can change your password to something that you find easier to r=
emember.</p>

--B_ALT_4b0ea5d842e0a--

Code:
$HTML_message = '<p>Hi, '.$userdetails->first_name.'</p>';
            $HTML_message .= '<p>As requested, your password has been reset. Here are your login details :<br />username: '.$userdetails->email.'<br />password: ' . $new_pass . '</p>';
            $HTML_message .= '<p>Once you have logged in you can change your password to something that you find easier to remember.</p>';
            $HTML_message .= '<p>' . base_url() . 'auth</p>';
            
            $non_HTML_message = 'Hi '.$userdetails->first_name.',\n\nAs requested, your password has been reset. Here are your login details :\n\nusername: '.$userdetails->email.'\npassword: ' . $new_pass . '\n\nOnce you have logged in you can change your password to something that you find easier to remember.\n\n' . base_url() . 'auth\n\n';
            
            $this->email->initialize(array(
                'protocol' => 'sendmail',
                'mailpath' => '/usr/sbin/sendmail',
                'mailtype' => 'html',
                'charset'  => 'iso-8859-1',
                'wordwrap' => FALSE,
            ));
            
            // Email their details
            $this->email->from('[email protected]');
            $this->email->to($this->input->post('forgotten_email'));
            $this->email->subject('Password Reset');
            $this->email->message($HTML_message);
            $this->email->set_alt_message($non_HTML_message);
            $this->email->send();
#2

[eluser]BenRob[/eluser]
Please someone help.

I am really stuck
#3

[eluser]uptime[/eluser]
Did you check your spam folder?
#4

[eluser]BenRob[/eluser]
[quote author="uptime" date="1259277908"]Did you check your spam folder?[/quote]

yeah I've checked it there is nothing there.
#5

[eluser]uptime[/eluser]
Can you try SMTP instead of Sendmail?

(assuming you have an SMTP app on this server)

It's probably a sendmail/server configuration issue, not PHP.
#6

[eluser]BenRob[/eluser]
[quote author="uptime" date="1259278707"]Can you try SMTP instead of Sendmail?

(assuming you have an SMTP app on this server)

It's probably a sendmail/server configuration issue, not PHP.[/quote]

The server doesnt use smtp it's weird but normal PHP mail function will work but the CI won't
#7

[eluser]uptime[/eluser]
Is your email ben [[at]] gmail? I thought the minimum chars was like 4,5 or 6 chars, I got mine ('uptime') days after gmail went into a private Beta and I remember it had a minimum char requirement.

I took ben@ from the debug info, is it the correct address?

Also, I don't see the html tags in the debug but do see them in the code, is this normal?
#8

[eluser]uptime[/eluser]
Just a thought on how to debug it...

You should probably debug it on system/libraries/Email.php around line 1538 (function _send_with_sendmail()).

I would probably var_dump( $this->mailpath . " -oi -f ".$this->clean_email($this->_headers['From'])." -t", $status );

right after $status is returned.

Make sure mailpath (sendmail binary) is the correct path (you can use "which sendmail"), make sure the headers make sense and finally, check out the returned status.

Maybe it will give you a hint...

Happy (yeah, right...) debugging!
#9

[eluser]Unknown[/eluser]
thanks
#10

[eluser]Unknown[/eluser]
Just turn off the spam filter in Rackspace email program
settings > Spam settings...
you will receive all the emails.




Theme © iAndrew 2016 - Forum software by © MyBB