CodeIgniter Forums
problem sending mail to gmail - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: problem sending mail to gmail (/showthread.php?tid=12962)



problem sending mail to gmail - El Forum - 11-05-2008

[eluser]socs[/eluser]
I'm using php mail with a multipart header and it fails when sending to gmail.

In the mail log I'm seeing...
(host gmail-smtp-in.l.google.com[72.14.205.27] said: 451 4.5.0 SMTP protocol violation, see RFC 2821 p30si1022849qbp.14 (in reply to end of DATA command))

Any thoughts ? It works when sending to anything but gmail.

Code:
$headers  = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: multipart/alternative; boundary="';
        $headers .= $mime_boundary.'"';    
        $headers .= "\r\n";
        $headers .= 'From: ' . $from . "\r\n";



problem sending mail to gmail - El Forum - 11-05-2008

[eluser]socs[/eluser]
Looks like gmail likes \n instead of \r\n in the headers. It's working after making that change.