Hi guys, I created a small script to send emails with mail() command. I sent test email to three email addresses. 1. Gmail add (email arrived in Inbox) 2. Gmail add (email arrived in SPAM) 3. Yahoo add (email arrived in SPAM) I can't understand why email address is coming in Inbox into one email and in SPAM in 2 email addresses? GCS
Gmail let one through, then noticed that the same email is being sent twice to different users and blocked it. Yahoo probably noticed something like spam in your email content. There was a website (which I couldn't remember) that checks your mail content for possible spam (special phrases that count as spam and so on).
Check to see if the sending IP address has rDNS assigned to it. Chances are it doesn't but that's something your host will have to fix for you.
Also, are you specifying FROM, SUBJECT etc? You are probably just experimenting, and so only specifying the recipient's email address, but most spam filters will flag emails that do not have a sender properly specified.
Either your ip is blacklisted, you don't have a proper mailserver eg. tls and certificates. You didn't supply proper headers.
<?php $to = "friends email id"; $subject = "Test mail"; $message = "Hello! This is a simple email message."; $from = "my email id"; $headers = "From: $from"; mail($to,$subject,$message,$headers); echo "Mail Sent."; ?> i tried this simple script but it showing error !!!!!!! Warning: mail() [function.mail]: SMTP server response: 550 Access denied - Invalid HELO name (See RFC2821 4.1.1.1) in G:\wamp\www\research\mail.php on line 7 Mail Sent.
Try this code: <?php $to = 'nobody@example.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: ' . "\r\n" . 'Reply-To: ' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?>
Hi guys Thanks everyone for replying and helping me. I want to clarify some points those are as follows: Proper header MIME-Version: 1.0\r\nContent-type: text/html; charset=iso-8859-1\r\nFrom: \"GlobalCashSite\" <xxxxxxxxxxxx@ymail.com>\r\nReply-To: \"GlobalCashSite\" <xxxxxxxxxxxxxe@ymail.com>\r\nX-Priority: 3\r\nX-Mailer: PHP 4\r\n I am not using domain based email to for from/to reply instead Yahoo email address. Unique Subject I am using last three digits of timestamp at the end of subject. I used this trick to make subject of each email unique. I am using this $unique = substr(time(),7,3); $emailsubject1 = $emailsubject." ".$unique; mail($line, $emailsubject1, $emailbody, "$email_headers"); Is this good idea to make subject of each email unique to prevent mails from being considered SPAM?????? As replied by [B]iAreCow[/B] how I can check that I am not using spam-friendly words in my email? As mentioned by [B]theapparatus[/B] how I can check rDNS assignment? As mentioned by [B]Kaizoku[/B] how I can check if my IP is not blacklisted? GCS
http://remote.12dt.com/ Try checking the IP address that's actually assigned to be sending the emails.
Guys As per advise of my hosting I also enabled Domain Key and SPF to send emails directly into my subscriber's Inbox but still fail? Any help please? GCS
This code works perfectly for me: // Headers $to = "some@domain.com"; $headers = "MIME-Version: 1.0\n"; $headers .= "Content-type: text/plain; charset=utf-8\n"; $headers .= "From: Example.net <noreply@example.net>\n"; $headers .= "X-Mailer: PHP's mail() Function\n"; mail($to, "Subject", $message, $headers); PHP: It works for me.. On Live/Hotmail too.