RE: [PHP] Complications when sending HTML email
Hello, Best group member, I am sending HTML email with PHP. I use the example code in the manual to try, and the email is sent. However, it is not decoded correctly in my Outlook. I checked thru webmail clients, and then it work. I thought it was my Outlook that was not correct, but I am receiving HTML emails from other sources that are displayed correctly. In the bottom I have the email that is sent to me, it is displayed like this in Outlook. Is there maybe something I have to add in the header to get it to work with Outlook? It is hard to tell without seeing your mail composing code. Anyway, decoding problems usally means wrong encoding. Regardless of the character set you use, you need to send your messages encoded with quoted-printable. If you do not do that, long lines may be truncated and non-ASCII characters may be swapped by ASCII characters. Another problem, is sending HTML only messages. This is a big no no. Well encoded HTML messages do not cause decoding problems but some mail systems like Hotmail may discard the messages. The right thing to do is to compose HTML messages with an alternative text part encapsualting both in a MIME multipart/alternative part. This is not a trivial matter but it is the right thing to do. If you look in Google I am sure you will find plenty of tutorials on how to do it with PHP functions for encoding quoted printable and composing multipart/alternative messages as needed. Alternatively, if you do not want to take much time figuring how to do it yourself, you may take advantage of many existing ready to use classes of objects for composing and sending MIME compliant messages like for instance this one: http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos info at phpclasses dot org Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Complications when sending HTML email
Did you put this in your headers? MIME-Version: 1.0\r\nContent-Type: text/html; charset=iso-8859-1\r\n ? mail([EMAIL PROTECTED],HTML TEST,HTMLBODYBTest/B/BODY/HTML,MIME-Version: 1.0\r\nContent-Type: text/html; charset=iso-8859-1\r\nFrom:[EMAIL PROTECTED]); ? Sincerely berber Visit the Weber Sites Today, To see where PHP might take you tomorrow. PHP code examples : http://www.weberdev.com PHP MySQL Forums : http://www.weberforums.com Learn PHP MySQL Playing Trivia : http://www.webertrivia.com PHP Web Logs : http://www.weberblogs.com Web Development Index http://www.weberindex.com Web Templates http://www.webertemplates.com Search for PHP Code from your browser http://toolbar.weberdev.com Free Uptime Monitor : http://uptime.weberdev.com PHP content for your site : http://content.weber-sites.com -Original Message- From: Peter Lauri [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 6:52 AM To: php-general@lists.php.net Subject: [PHP] Complications when sending HTML email Best group member, I am sending HTML email with PHP. I use the example code in the manual to try, and the email is sent. However, it is not decoded correctly in my Outlook. I checked thru webmail clients, and then it work. I thought it was my Outlook that was not correct, but I am receiving HTML emails from other sources that are displayed correctly. In the bottom I have the email that is sent to me, it is displayed like this in Outlook. Is there maybe something I have to add in the header to get it to work with Outlook? Cheers, Peter -Original Message- From: Sent: Tuesday, February 14, 2006 11:31 AM Subject: Birthday Reminders for August Content-type: text/html; charset=iso-8859-1 To: Peter [EMAIL PROTECTED] From: Testserver [EMAIL PROTECTED] html head titleBirthday Reminders for August/title /head body pHere are the birthdays upcoming in August!/p table tr thPerson/ththDay/ththMonth/ththYear/th /tr tr tdJoe/tdtd3rd/tdtdAugust/tdtd1970/td /tr tr tdSally/tdtd17th/tdtdAugust/tdtd1973/td /tr /table /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Complications when sending HTML email
Does not work. http://www.zend.com/zend/spotlight/sendmimeemailpart1.php?article=sendmimeem ailpart1kind=slid=3148open=1anc=0view=1 tells me that I should put 'three newlines between the Content-Transfer-Encoding and the start of the section.' But still that does not work, hrm. Anyone with a simple html-example that works fine with Outlook? Best regards, Peter Lauri -Original Message- From: Weber Sites LTD [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 4:27 PM To: 'Peter Lauri'; php-general@lists.php.net Subject: RE: [PHP] Complications when sending HTML email Did you put this in your headers? MIME-Version: 1.0\r\nContent-Type: text/html; charset=iso-8859-1\r\n ? mail([EMAIL PROTECTED],HTML TEST,HTMLBODYBTest/B/BODY/HTML,MIME-Version: 1.0\r\nContent-Type: text/html; charset=iso-8859-1\r\nFrom:[EMAIL PROTECTED]); ? Sincerely berber Visit the Weber Sites Today, To see where PHP might take you tomorrow. PHP code examples : http://www.weberdev.com PHP MySQL Forums : http://www.weberforums.com Learn PHP MySQL Playing Trivia : http://www.webertrivia.com PHP Web Logs : http://www.weberblogs.com Web Development Index http://www.weberindex.com Web Templates http://www.webertemplates.com Search for PHP Code from your browser http://toolbar.weberdev.com Free Uptime Monitor : http://uptime.weberdev.com PHP content for your site : http://content.weber-sites.com -Original Message- From: Peter Lauri [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 6:52 AM To: php-general@lists.php.net Subject: [PHP] Complications when sending HTML email Best group member, I am sending HTML email with PHP. I use the example code in the manual to try, and the email is sent. However, it is not decoded correctly in my Outlook. I checked thru webmail clients, and then it work. I thought it was my Outlook that was not correct, but I am receiving HTML emails from other sources that are displayed correctly. In the bottom I have the email that is sent to me, it is displayed like this in Outlook. Is there maybe something I have to add in the header to get it to work with Outlook? Cheers, Peter -Original Message- From: Sent: Tuesday, February 14, 2006 11:31 AM Subject: Birthday Reminders for August Content-type: text/html; charset=iso-8859-1 To: Peter [EMAIL PROTECTED] From: Testserver [EMAIL PROTECTED] html head titleBirthday Reminders for August/title /head body pHere are the birthdays upcoming in August!/p table tr thPerson/ththDay/ththMonth/ththYear/th /tr tr tdJoe/tdtd3rd/tdtdAugust/tdtd1970/td /tr tr tdSally/tdtd17th/tdtdAugust/tdtd1973/td /tr /table /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Complications when sending HTML email
Peter Lauri wrote: Does not work. http://www.zend.com/zend/spotlight/sendmimeemailpart1.php?article=sendmimeem ailpart1kind=slid=3148open=1anc=0view=1 tells me that I should put 'three newlines between the Content-Transfer-Encoding and the start of the section.' But still that does not work, hrm. Anyone with a simple html-example that works fine with Outlook? phpmailer.sourceforge.net -- easy to use, and it works (+ I learnt quite a bit about how mail should be put together by looking at the code and output of the this tool) Best regards, Peter Lauri -Original Message- From: Weber Sites LTD [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 4:27 PM To: 'Peter Lauri'; php-general@lists.php.net Subject: RE: [PHP] Complications when sending HTML email Did you put this in your headers? MIME-Version: 1.0\r\nContent-Type: text/html; charset=iso-8859-1\r\n ? mail([EMAIL PROTECTED],HTML TEST,HTMLBODYBTest/B/BODY/HTML,MIME-Version: 1.0\r\nContent-Type: text/html; charset=iso-8859-1\r\nFrom:[EMAIL PROTECTED]); ? Sincerely berber Visit the Weber Sites Today, To see where PHP might take you tomorrow. PHP code examples : http://www.weberdev.com PHP MySQL Forums : http://www.weberforums.com Learn PHP MySQL Playing Trivia : http://www.webertrivia.com PHP Web Logs : http://www.weberblogs.com Web Development Index http://www.weberindex.com Web Templates http://www.webertemplates.com Search for PHP Code from your browser http://toolbar.weberdev.com Free Uptime Monitor : http://uptime.weberdev.com PHP content for your site : http://content.weber-sites.com -Original Message- From: Peter Lauri [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 6:52 AM To: php-general@lists.php.net Subject: [PHP] Complications when sending HTML email Best group member, I am sending HTML email with PHP. I use the example code in the manual to try, and the email is sent. However, it is not decoded correctly in my Outlook. I checked thru webmail clients, and then it work. I thought it was my Outlook that was not correct, but I am receiving HTML emails from other sources that are displayed correctly. In the bottom I have the email that is sent to me, it is displayed like this in Outlook. Is there maybe something I have to add in the header to get it to work with Outlook? Cheers, Peter -Original Message- From: Sent: Tuesday, February 14, 2006 11:31 AM Subject: Birthday Reminders for August Content-type: text/html; charset=iso-8859-1 To: Peter [EMAIL PROTECTED] From: Testserver [EMAIL PROTECTED] html head titleBirthday Reminders for August/title /head body pHere are the birthdays upcoming in August!/p table tr thPerson/ththDay/ththMonth/ththYear/th /tr tr tdJoe/tdtd3rd/tdtdAugust/tdtd1970/td /tr tr tdSally/tdtd17th/tdtdAugust/tdtd1973/td /tr /table /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Complications when sending HTML email
It works for me :) I tested it before mailing you the answer. I have no idea what could be causing the problem. berber -Original Message- From: Peter Lauri [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 11:51 AM To: 'Weber Sites LTD'; php-general@lists.php.net Subject: RE: [PHP] Complications when sending HTML email Does not work. http://www.zend.com/zend/spotlight/sendmimeemailpart1.php?article=sendmimeem ailpart1kind=slid=3148open=1anc=0view=1 tells me that I should put 'three newlines between the Content-Transfer-Encoding and the start of the section.' But still that does not work, hrm. Anyone with a simple html-example that works fine with Outlook? Best regards, Peter Lauri -Original Message- From: Weber Sites LTD [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 4:27 PM To: 'Peter Lauri'; php-general@lists.php.net Subject: RE: [PHP] Complications when sending HTML email Did you put this in your headers? MIME-Version: 1.0\r\nContent-Type: text/html; charset=iso-8859-1\r\n ? mail([EMAIL PROTECTED],HTML TEST,HTMLBODYBTest/B/BODY/HTML,MIME-Version: 1.0\r\nContent-Type: text/html; charset=iso-8859-1\r\nFrom:[EMAIL PROTECTED]); ? Sincerely berber Visit the Weber Sites Today, To see where PHP might take you tomorrow. PHP code examples : http://www.weberdev.com PHP MySQL Forums : http://www.weberforums.com Learn PHP MySQL Playing Trivia : http://www.webertrivia.com PHP Web Logs : http://www.weberblogs.com Web Development Index http://www.weberindex.com Web Templates http://www.webertemplates.com Search for PHP Code from your browser http://toolbar.weberdev.com Free Uptime Monitor : http://uptime.weberdev.com PHP content for your site : http://content.weber-sites.com -Original Message- From: Peter Lauri [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 6:52 AM To: php-general@lists.php.net Subject: [PHP] Complications when sending HTML email Best group member, I am sending HTML email with PHP. I use the example code in the manual to try, and the email is sent. However, it is not decoded correctly in my Outlook. I checked thru webmail clients, and then it work. I thought it was my Outlook that was not correct, but I am receiving HTML emails from other sources that are displayed correctly. In the bottom I have the email that is sent to me, it is displayed like this in Outlook. Is there maybe something I have to add in the header to get it to work with Outlook? Cheers, Peter -Original Message- From: Sent: Tuesday, February 14, 2006 11:31 AM Subject: Birthday Reminders for August Content-type: text/html; charset=iso-8859-1 To: Peter [EMAIL PROTECTED] From: Testserver [EMAIL PROTECTED] html head titleBirthday Reminders for August/title /head body pHere are the birthdays upcoming in August!/p table tr thPerson/ththDay/ththMonth/ththYear/th /tr tr tdJoe/tdtd3rd/tdtdAugust/tdtd1970/td /tr tr tdSally/tdtd17th/tdtdAugust/tdtd1973/td /tr /table /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php