This is a discussion on Mail Function and Hotmail.com within the PHP Language forums, part of the PHP Programming Forums category; Hi everybody,, I've the following proplem: When I send an email to Hotmail account it: 1. Goes directory to ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi everybody,,
I've the following proplem: When I send an email to Hotmail account it: 1. Goes directory to the Junk Email ! OR 2. Goesn't go at all ! My website is in a dedicated server using: Linux 2.4.21, Apache, PHP, MySQL and I'm using the following function to send my emails: ============================== function SendEmail($veFmName, $veFmEmail, $veToName, $veToEmail, $veSubj, $veBody) { $varHeader = "MIME-Version: 1.0\r\n"; $varHeader .= "Content-type: text/html; charset=windows-1256\r\n"; $varHeader .= "X-Priority: 3\r\n"; $varHeader .= "X-MSMail-Priority: Normal\r\n"; $varHeader .= "From: $veFmName <$veFmEmail>\r\n"; $varHeader .= "Return-Path: $veFmEmail\r\n"; $veBody = "<html><body>" . $veBody . "</body></html>"; return mail($veToEmail, $veSubj, $veBody, $varHeader, "-f" . $veFmEmail); } ============================== It's been now several months I tried to solve this problem, and I've played with the header many times, but the problem still there; the email sometimes doesn't go to hotmail OR goes to junk email! This is an email sample sent from my site: ============================== X-Gmail-Received: 4e24a44374ea625894407eb9fb89a65de91b36e3 Delivered-To: engrkhalid@gmail.com Received: by 10.54.32.17 with SMTP id f17cs16564wrf; Sun, 2 Jan 2005 09:58:18 -0800 (PST) Received: by 10.54.32.28 with SMTP id f28mr293282wrf; Sun, 02 Jan 2005 09:58:18 -0800 (PST) Return-Path: <email@mstaml.com> Received: from server.mstaml.com (server.mstaml.com [69.93.171.50]) by mx.gmail.com with ESMTP id 66si150386wra; Sun, 02 Jan 2005 09:58:18 -0800 (PST) Received-SPF: pass (gmail.com: domain of email@mstaml.com designates 69.93.171.50 as permitted sender) Received: from nobody by server.mstaml.com with local (Exim 4.43) id 1Cl9zd-0000IV-5k for engrkhalid@gmail.com; Sun, 02 Jan 2005 20:58:17 +0300 To: engrkhalid@gmail.com Subject: دعوة من John MIME-Version: 1.0 Content-type: text/html; charset=windows-1256 X-Priority: 3 X-MSMail-Priority: Normal From: موقع مستعمل <email@mstaml.com> Message-Id: <E1Cl9zd-0000IV-5k@server.mstaml.com> Date: Sun, 02 Jan 2005 20:58:17 +0300 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server.mstaml.com X-AntiAbuse: Original Domain - gmail.com X-AntiAbuse: Originator/Caller UID/GID - [99 99] / [47 12] X-AntiAbuse: Sender Address Domain - mstaml.com X-Source: X-Source-Args: X-Source-Dir: <html><body><P dir=rtl>السلام عليكم،،<BR><BR>يدعوك صديقك John لزيارة موقع مستعمل على عنوان:<BR><P dir=rtl align=center><BR><A HREF="http://www.mstaml.com">www.mstaml.com</A><BR> =========== Ø*راج الإنترنت العربي ===========<BR>=========== مستعمل ===========<BR>=====================<BR>== مع خالصتØ*ياتنا ==<BR>____________________<BR>هذه رسالة ترسل آلياً من موقع مستعمل... الرجاء عدم الرد عليها.<BR> </body></html> ============================== Could anyone help me please! |
|
|||
|
Hello,
on 01/14/2005 12:34 AM engrkhalid@gmail.com said the following: > Hi everybody,, > > I've the following proplem: > When I send an email to Hotmail account it: > 1. Goes directory to the Junk Email ! > OR > 2. Goesn't go at all ! > > My website is in a dedicated server using: Linux 2.4.21, Apache, PHP, > MySQL > and I'm using the following function to send my emails: That is because you can't send HTML only messages. Real mail clients always compose HTML messages with an alternative text part. When Hotmail gets an HTML message that does not have a text part, it assumes correctly that you are not using a real client, so the chances that the message is SPAM are great. You need to use MIME multipart alternative messages with the text and HTML parts in the same body so the messages are sent like with normal user mail clients. If you do not know how to do this, you may want to try this popular MIME message composing and sending class that follows the necessary standard requirements to minimize the chances that your messages are confused with SPAM. http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html |
|
|||
|
Manuel Lemos wrote:
>> I've the following proplem: >> When I send an email to Hotmail account it: >> 1. Goes directory to the Junk Email ! >> OR >> 2. Goesn't go at all ! >> >> My website is in a dedicated server using: Linux 2.4.21, Apache, >> PHP, >> MySQL >> and I'm using the following function to send my emails: > > That is because you can't send HTML only messages. Real mail clients > always compose HTML messages with an alternative text part. When > Hotmail gets an HTML message that does not have a text part, it > assumes correctly that you are not using a real client, so the > chances that the message is SPAM are great. The stated fact that you *can't* send HTML only messages with real email clients is false. It is possible, however it is not wise. And some clients don't allow it (MSOE for example). However, there seems to be a bit more fundamental problem with the original poster's message, ie. it doesn't follow the standard... It doesn't leave an empty line between the headers and body of message. Of course this can be caused by a copy/paste-operation of the message contents, and not the cause of the problem. However, if this is the case, it would explain why the messages sometimes don't arrive at all. And of course there's the problem that the spamfilter Hotmail uses is a joke to begin with :) -- Markku Uttula |
|
|||
|
engrkhalid@gmail.com wrote:
> Hi everybody,, > > I've the following proplem: > When I send an email to Hotmail account it: > 1. Goes directory to the Junk Email ! > OR > 2. Goesn't go at all ! There can be many problems. But, to my knowledge, using PHPMailer class <http://phpmailer.sourceforge.net/>, you can get rid of Junk Email problem. -- <?php echo 'Just another PHP saint'; ?> Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/ |
|
|||
|
Hello,
on 01/14/2005 05:45 AM Markku Uttula said the following: >>> I've the following proplem: >>> When I send an email to Hotmail account it: >>> 1. Goes directory to the Junk Email ! >>> OR >>> 2. Goesn't go at all ! >>> >>> My website is in a dedicated server using: Linux 2.4.21, Apache, PHP, >>> MySQL >>> and I'm using the following function to send my emails: >> >> That is because you can't send HTML only messages. Real mail clients >> always compose HTML messages with an alternative text part. When >> Hotmail gets an HTML message that does not have a text part, it >> assumes correctly that you are not using a real client, so the >> chances that the message is SPAM are great. > > The stated fact that you *can't* send HTML only messages with real email You can send HTML messages that way but in the default spam filter level Hotmail will consider HTML only messages as junk, which is the exact problem that the original poster reported. This is a know problem especially with Hotmail. Other free mail services may be more tolerant. > However, there seems to be a bit more fundamental problem with the > original poster's message, ie. it doesn't follow the standard... It > doesn't leave an empty line between the headers and body of message. Of Actually, if you see his source code he leaves an extra line after the last header line. The mail() function adds more two line breaks, so his last line break is not even necessary, but it is not harmful either. So that is not the problem. -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html |
|
|||
|
Hello, and thank you all very much for your replys.
Manuel Lemos, I've tryed the class you told me (clsSendMail.php) which in this address: http://www.phpclasses.org/browse/package/1414.html But, still,, all the emails go to the junk mail! R. Rajesh Jeba Anbiah, I've tryed your class too, and same problem, all emails go to the junk mail: http://prdownloads.sourceforge.net/p..._mirror=aleron .. .. Could you please help me. |
|
|||
|
Hello,
on 01/15/2005 01:52 AM engrkhalid@gmail.com said the following: > Hello, and thank you all very much for your replys. > > Manuel Lemos, I've tryed the class you told me (clsSendMail.php) which > in this address: > http://www.phpclasses.org/browse/package/1414.html > But, still,, all the emails go to the junk mail! That is not the right class. Check here: http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html |
|
|||
|
engrkhalid@gmail.com wrote:
<snip> > R. Rajesh Jeba Anbiah, I've tryed your class too, and same problem, all > emails go to the junk mail: > http://prdownloads.sourceforge.net/p..._mirror=aleron > . > . > Could you please help me. There are more than one reasons. If PHPMailer isn't helpful, your domain name or from-name/email might be blacklisted. -- <?php echo 'Just another PHP saint'; ?> Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/ |
|
|||
|
Thanks for all your replys.
Manuel Lemos, thank you very much, it is working :) I have a question please: all what I need is sending email, so I'll use "email_message.php", is that right? and I'm trying to use "test_html_mail_message.php" to send an HTML email without attachment but I couldn't. Do you have a simple test html example without attachment. Thank you. |