<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: PHP mail() function and GMail</title>
	<atom:link href="http://www.richardlord.net/blog/php-mail-and-gmail/feed" rel="self" type="application/rss+xml" />
	<link>http://www.richardlord.net/blog/php-mail-and-gmail</link>
	<description>Actionscript/Flex, PHP and Java developer</description>
	<lastBuildDate>Mon, 08 Mar 2010 15:42:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: paddingtondesign</title>
		<link>http://www.richardlord.net/blog/php-mail-and-gmail/comment-page-1#comment-6059</link>
		<dc:creator>paddingtondesign</dc:creator>
		<pubDate>Mon, 02 Apr 2007 15:27:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.bigroom.co.uk/blog/php-mail-and-gmail/#comment-6059</guid>
		<description>yep, same problem here. stripping out the \r fixed it for me in gmail...
&lt;code&gt;
if (preg_match(&#039;/gmail/&#039;,$email_address))
      $headers = str_replace(&quot;\r\n&quot;,&quot;\n&quot;,$headers);
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>yep, same problem here. stripping out the \r fixed it for me in gmail&#8230;<br />
<code><br />
if (preg_match('/gmail/',$email_address))<br />
      $headers = str_replace("\r\n","\n",$headers);<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rodrigo</title>
		<link>http://www.richardlord.net/blog/php-mail-and-gmail/comment-page-1#comment-3599</link>
		<dc:creator>rodrigo</dc:creator>
		<pubDate>Fri, 02 Mar 2007 20:58:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.bigroom.co.uk/blog/php-mail-and-gmail/#comment-3599</guid>
		<description>I had the same problem too and after a lot of hours trying to solve it, you save me!
Thanks!
Rodrigo</description>
		<content:encoded><![CDATA[<p>I had the same problem too and after a lot of hours trying to solve it, you save me!<br />
Thanks!<br />
Rodrigo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://www.richardlord.net/blog/php-mail-and-gmail/comment-page-1#comment-2636</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Fri, 16 Feb 2007 19:10:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.bigroom.co.uk/blog/php-mail-and-gmail/#comment-2636</guid>
		<description>We had this exact same problem.   Removing \r fixed it as well.  Thanks.</description>
		<content:encoded><![CDATA[<p>We had this exact same problem.   Removing \r fixed it as well.  Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dean</title>
		<link>http://www.richardlord.net/blog/php-mail-and-gmail/comment-page-1#comment-1612</link>
		<dc:creator>Dean</dc:creator>
		<pubDate>Wed, 31 Jan 2007 14:43:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.bigroom.co.uk/blog/php-mail-and-gmail/#comment-1612</guid>
		<description>I had the same problem and the removal of the \r fixed it. Thanks, Martin.</description>
		<content:encoded><![CDATA[<p>I had the same problem and the removal of the \r fixed it. Thanks, Martin.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin</title>
		<link>http://www.richardlord.net/blog/php-mail-and-gmail/comment-page-1#comment-1159</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Mon, 22 Jan 2007 22:44:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.bigroom.co.uk/blog/php-mail-and-gmail/#comment-1159</guid>
		<description>This was stupid. My script didn&#039;t work with gmail until I stripped \r and just used \n. Both created a double rowbreak resulting in gmail thinking headers were all sent after first row.</description>
		<content:encoded><![CDATA[<p>This was stupid. My script didn&#8217;t work with gmail until I stripped \r and just used \n. Both created a double rowbreak resulting in gmail thinking headers were all sent after first row.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.richardlord.net/blog/php-mail-and-gmail/comment-page-1#comment-364</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Fri, 15 Dec 2006 23:35:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.bigroom.co.uk/blog/php-mail-and-gmail/#comment-364</guid>
		<description>Swift Mailer is newer and in active development.  PHPMailer died a quiet death a couple of years ago (just look at the last change on SF.net!) yet everybody still insists upon using it.  It&#039;s also pretty nasty OOP ;)

Swift Mailer will be making it&#039;s next release very soon which actually provides the ability to compose your email with swift and send it elsewhere among other enhancements such as an improved plugin API.

I am more commonly seeing Swift recommended as a standard these days over PHPMailer although there still seem to be a lot of people who stick with the one that started first for whatever reasons they have.

*cough* if you hadn&#039;t guessed, I wrote swift hence the slightly biased post :P</description>
		<content:encoded><![CDATA[<p>Swift Mailer is newer and in active development.  PHPMailer died a quiet death a couple of years ago (just look at the last change on SF.net!) yet everybody still insists upon using it.  It&#8217;s also pretty nasty OOP <img src='http://www.richardlord.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Swift Mailer will be making it&#8217;s next release very soon which actually provides the ability to compose your email with swift and send it elsewhere among other enhancements such as an improved plugin API.</p>
<p>I am more commonly seeing Swift recommended as a standard these days over PHPMailer although there still seem to be a lot of people who stick with the one that started first for whatever reasons they have.</p>
<p>*cough* if you hadn&#8217;t guessed, I wrote swift hence the slightly biased post <img src='http://www.richardlord.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: richard</title>
		<link>http://www.richardlord.net/blog/php-mail-and-gmail/comment-page-1#comment-235</link>
		<dc:creator>richard</dc:creator>
		<pubDate>Sat, 02 Dec 2006 15:36:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.bigroom.co.uk/blog/php-mail-and-gmail/#comment-235</guid>
		<description>&lt;p&gt;Jan, the mail() function will always send mail as iso 8559-1, that&#039;s why it fails with characters in any other encoding. However, mb_send_mail() is specifically intended for sending mail using other encodings (it&#039;s part of the mbstring extension for PHP and is intended as a direct replacement for mail() where other encodings are required).&lt;/p&gt;
&lt;p&gt;My original setup used mb_send_mail() to send UTF-8 mail. This worked fine with all the mail readers I&#039;ve tested it with apart from GMail.&lt;/p&gt;
&lt;p&gt;Even when sending iso-8559-1 mail using the mail() function, GMail fails to use the sender data from the header and shows the sender as unknown - this is the second problem outlined above.&lt;/p&gt;
&lt;p&gt;I looked at PHPMailer but was dissuaded by the complexity of the interface and the fact that it doesn&#039;t appear to be worked on currently - the latest version is 16 months old. Not that there&#039;s anything wrong with that but my brief comparison with Swift Mailer suggests the latter has a similar feature set with a simpler interface.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Jan, the mail() function will always send mail as iso 8559-1, that&#8217;s why it fails with characters in any other encoding. However, mb_send_mail() is specifically intended for sending mail using other encodings (it&#8217;s part of the mbstring extension for PHP and is intended as a direct replacement for mail() where other encodings are required).</p>
<p>My original setup used mb_send_mail() to send UTF-8 mail. This worked fine with all the mail readers I&#8217;ve tested it with apart from GMail.</p>
<p>Even when sending iso-8559-1 mail using the mail() function, GMail fails to use the sender data from the header and shows the sender as unknown &#8211; this is the second problem outlined above.</p>
<p>I looked at PHPMailer but was dissuaded by the complexity of the interface and the fact that it doesn&#8217;t appear to be worked on currently &#8211; the latest version is 16 months old. Not that there&#8217;s anything wrong with that but my brief comparison with Swift Mailer suggests the latter has a similar feature set with a simpler interface.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ante Vrli</title>
		<link>http://www.richardlord.net/blog/php-mail-and-gmail/comment-page-1#comment-234</link>
		<dc:creator>Ante Vrli</dc:creator>
		<pubDate>Sat, 02 Dec 2006 15:36:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.bigroom.co.uk/blog/php-mail-and-gmail/#comment-234</guid>
		<description>I&#039;m using simple mail() and have no problems with GMail. It could be I guessed some special order of headers that GMail prefers. I don&#039;t know. Here&#039;s the code anyway:

&lt;code&gt;$headers = &quot;MIME-Version: 1.0\r\n&quot;;
$headers .= &quot;Content-type: text/plain; charset=iso-8859-2\r\nContent-Transfer-Encoding: 8bit\r\nX-Priority: 1\r\nX-MSMail-Priority: High\r\n&quot;;
$headers .= &quot;From: $from\r\n&quot; . &quot;Reply-To: $from\r\n&quot; . &quot;X-Mailer: PHP/&quot; . phpversion() . &quot;\r\nX-originating-IP: &quot; . remoteaddr () . &quot;\r\n&quot;;
$success = @mail ($to, $subject, $message, $headers);&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I&#8217;m using simple mail() and have no problems with GMail. It could be I guessed some special order of headers that GMail prefers. I don&#8217;t know. Here&#8217;s the code anyway:</p>
<p><code>$headers = "MIME-Version: 1.0\r\n";<br />
$headers .= "Content-type: text/plain; charset=iso-8859-2\r\nContent-Transfer-Encoding: 8bit\r\nX-Priority: 1\r\nX-MSMail-Priority: High\r\n";<br />
$headers .= "From: $from\r\n" . "Reply-To: $from\r\n" . "X-Mailer: PHP/" . phpversion() . "\r\nX-originating-IP: " . remoteaddr () . "\r\n";<br />
$success = @mail ($to, $subject, $message, $headers);</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Gorman</title>
		<link>http://www.richardlord.net/blog/php-mail-and-gmail/comment-page-1#comment-224</link>
		<dc:creator>Jan Gorman</dc:creator>
		<pubDate>Fri, 01 Dec 2006 22:22:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.bigroom.co.uk/blog/php-mail-and-gmail/#comment-224</guid>
		<description>Maybe try using PHPMailer http://phpmailer.sourceforge.net/

I have discovered though, that I need to set the mail encoding to iso 8559-1 or whatever it is when sending out multipart and pure text messages, otherwise the special characters in German all get stuffed up (with any mailer btw.).
Oh, and in case you&#039;re using some sort of templates coming from files that were stored in utf8, a utf8_decode before putting the string into the mail helps as well. Maybe that&#039;s your issue right there.</description>
		<content:encoded><![CDATA[<p>Maybe try using PHPMailer <a href="http://phpmailer.sourceforge.net/" rel="nofollow">http://phpmailer.sourceforge.net/</a></p>
<p>I have discovered though, that I need to set the mail encoding to iso 8559-1 or whatever it is when sending out multipart and pure text messages, otherwise the special characters in German all get stuffed up (with any mailer btw.).<br />
Oh, and in case you&#8217;re using some sort of templates coming from files that were stored in utf8, a utf8_decode before putting the string into the mail helps as well. Maybe that&#8217;s your issue right there.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
