Welcome Guest, Not a member yet? Register   Sign In
problem sending mail to gmail

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[] 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.

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

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

Theme © iAndrew 2016 - Forum software by © MyBB