Yes, this is another Authenticated SMTP Mail question!
I am running a a Vista Windows system using WAMPServer (Apache 2.2.11 and PHP 5.3.0)
I am using the following code to try to get this to work, it always says that the message was sent, but it never arrives. I have tried sending to several friends with the same result. I have doubled checked the $host and $port values and they are correct.
Any suggestions will be appreciated!
<code>
<?php
include("Mail.php");
/* mail setup recipients, subject etc */
$recipients = "someone@att.net";
$headers["From"] = "someoneelse@att.net";
$headers["To"] = "someone@att.net";
$headers["Subject"] = "User feedback";
$mailmsg = "Hello, Please take a moment to reply to this test for me!";
/* SMTP server name, port, user/passwd */
$smtpinfo["host"] = "smtp.att.yahoo.com";
$smtpinfo["port"] = "465";
$smtpinfo["auth"] = true;
$smtpinfo["username"] = "anyoneelse";
$smtpinfo["password"] = "itshidden";
/* Create the mail object using the Mail::factory method */
$mail_object =& Mail::factory("smtp", $smtpinfo);
/* Ok send mail */
$mail_object->send($recipients, $headers, $mailmsg);
//$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail_object)) {
echo("<p>" . $mail_object->getMessage() . "</p>");
} else {
echo("<p>Message successfully sent!</p>");
}
?>
</code