PHP mail() going to SPAM--PLS Help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
anirbanb2004
Forum Newbie
Posts: 23
Joined: Sun Oct 15, 2006 4:21 pm

PHP mail() going to SPAM--PLS Help

Post by anirbanb2004 »

Hi,
I am having astrange problem with mail() .
I am using the fiollowing code

Code: Select all

$to=$email;
$subject='domain.com: Your application will be reviewed soon!';
 
$from='contact@anirban.com';
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .="From:".$from."\r\nContent-Type: text/html\r\nCc:anirbanb2004@yahoo.com\r\nReply-To:contact@racsuccess.com";
$body='Hi '.$fname.' '.$lname.', thanks for your interest in becoming a aaa mentor.<br>
mail($to,$subject,$body,$headers);
This is always sending mails to spam.Even for GMail and Yahoo it is not atall coming.

Can anyone suggest me what is wrong with the cldoe?

Thanks,
Aniran
Rovas
Forum Contributor
Posts: 272
Joined: Mon Aug 21, 2006 7:09 am
Location: Romania

Re: PHP mail() going to SPAM--PLS Help

Post by Rovas »

Your php code is correct. Check the code were you call this script to see if you send more than one email.
If you\ clients receive the emails in Spam folders it means that the mail address is considered spam by GMail, Yahoo and possibly other mail servers. You can talk to your users\ clients to select the email from you as being not spam or change your email address. Another solution is to convince the administrators of the servers that you' re not spammer so that they remove you from the spammer list.
anirbanb2004
Forum Newbie
Posts: 23
Joined: Sun Oct 15, 2006 4:21 pm

Re: PHP mail() going to SPAM--PLS Help

Post by anirbanb2004 »

Thanks A lot,
Is there any thing extra entries for headers that can prevent spamming?For Yahoo and Gmail it is not coming at all :cry: :banghead:
User avatar
novice4eva
Forum Contributor
Posts: 327
Joined: Thu Mar 29, 2007 3:48 am
Location: Nepal

Re: PHP mail() going to SPAM--PLS Help

Post by novice4eva »

After seeing your post i did a little search and someone was telling something about mail signature thing, but i literally don't know about the signature thingy, it also read that phpmailer would avoid such "PROBLEM", umm since this forum predominantly opts for swift mailer, i came across this http://swiftmailer.org/wikidocs/v3/tips/spam

So maybe using swiftmailer will avoid the problem of spam TOO !!

:drunk:
Post Reply