Page 1 of 1
recieveing mails in spam
Posted: Mon Sep 13, 2010 2:45 am
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
Re: recieveing mails in spam
Posted: Mon Sep 13, 2010 4:42 am
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?
Re: recieveing mails in spam
Posted: Mon Sep 13, 2010 7:36 am
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);
Re: recieveing mails in spam
Posted: Wed Sep 15, 2010 12:51 am
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.
Re: recieveing mails in spam
Posted: Wed Sep 15, 2010 12:59 am
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";