recieveing mails in spam

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
jsshanthi
Forum Newbie
Posts: 5
Joined: Fri Aug 27, 2010 5:21 am

recieveing mails in spam

Post by jsshanthi »

Hi,
I Have a form after successful submission a mail must be send to particular recipient and thank you mail is send to the person who filled the form ,The problem is i am receiving mails in spam whats the reason for going in spam I have kept Capture code also
Can please let me know what to do
cpetercarter
Forum Contributor
Posts: 474
Joined: Sat Jul 25, 2009 2:00 am

Re: recieveing mails in spam

Post by cpetercarter »

Do you mean that you are receiving spam? Or that the e-mails sent when your form is submitted are being treated as spam by your e-mail programme, and are therefore not appearing in your inbox?
jsshanthi
Forum Newbie
Posts: 5
Joined: Fri Aug 27, 2010 5:21 am

Re: recieveing mails in spam

Post by jsshanthi »

yes after submitting the form the email is not appearing in indox instead its appearing in spam
Her is the code: I have been included headers

$host = "ssl://smtp.gmail.com";
$port = "465";


$to = " xx@gmail.com"; // note the comma



$subject = " $_POST[company_website] ";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: About Wholesale Account' . "<$_POST>\r\n";$headers .= 'Cc: [email]mail@gmail.com' . "\r\n";
$headers .= 'Bcc: cc@gmail.com' . "\r\n";
mail($to, $subject, $message, $headers);
cpetercarter
Forum Contributor
Posts: 474
Joined: Sat Jul 25, 2009 2:00 am

Re: recieveing mails in spam

Post by cpetercarter »

I do not think that there is anything you can do in PHP which will ensure that gmail always puts these emails in your inbox and not in spam. I had a similar problem about emails sent to me from my website. The answer was to create a filter in gmail (in your gmail page, settings->filters->create a new filter) to tell gmail not to treat emails from my server's address as spam.
PradeepKr
Forum Newbie
Posts: 14
Joined: Wed Aug 11, 2010 8:29 am

Re: recieveing mails in spam

Post by PradeepKr »

Add your "from" email to your address book in gmail then it will not treat it as spam.
Also, have a look at

Code: Select all

$headers .= 'From: About Wholesale Account' . "<$_POST>\r\n";
it should be

Code: Select all

$headers .= 'From: About Wholesale Account' . <$_POST['from']>."\r\n"; 
Post Reply