Re: Re: Need help-Send email
| From: | nagendra prasad | Date: | Mon, 14 Sep 2009 23:20:28 +0000 |
| Subject: | Re: Re: Need help-Send email | ||
| References: | 1 2 3 4 5 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-46503@lists.php.net to get a copy of this message | ||
Hi Chris,
Thanks for the response. However I have coded the Email code with SMTP
authentication. But the problem is my mail is going to the SPAM not in the
inbox. I remember someone has said that if the code is sending the email and
if its going under SPAM folder then the code is correct but I have to work
on client filter. I don't know how? Can you or anyone help me in this.
Here is the code:
<?PHP
/* Setup your Subject and Message Body */
$subject='Testing PHP Email';
$body='Hi the is nagendra prasd.';
/* Specify your SMTP Server, Port and Valid From Address */
ini_set("SMTP","mail.localroot.200u.com");
ini_set("smtp_port","465");
ini_set("sendmail_from","nagendra802000@gmail.com");
/* Additional Headers */
$headers = "Cc:Real CC Name <nagendra802000@gmail.com>\r\n";
/* Try to send message and respond if it sends or fails. */
if(mail ('ToPersonsName <nagendra802000@gmail.com>', $subject, $body,
$headers )){
echo "<h2>Your Message was sent!</h2>";
}
else{
echo "<font color='red'><h2>Your Message Was Not
Sent!</h2></font>";
}
exit;
?>