Ok, so I'm sending an email through Yahoo's SMTP to friends and I have been using PHPMailer to send them on my up-to-date XAMPP localhost. What I am confused about is that sometimes it works, and other times it does not. Plus, when they do get the emails, it goes to their spam box?
Message: "Hey! I saw you this Friday outside of the 2 for 1 sales dept. The ad's we put up together look good! The manager wants to meet with us to discuss the new marketing strategy. What is your opinion of the ad campaign?"
-------------------------- PHP Code --------------------------
try {
$mail = new PHPMailer(true);
$mail->IsSMTP();
$mail->SMTPSecure = 'ssl';
$mail->SMTPAuth = true;
$mail->Host = SMTP_SERVER;
$mail->Port = SMTP_PORT;
$mail->Username = SMTP_USERNAME;
$mail->Password = SMTP_PASSWORD;
$mail->SMTPDebug = 2;
$mail->SetFrom(MAIL_ORDERS_ADDRESS, 'MsPotato');
$mail->Subject = 'Mr Potato Please!';
$mail->MsgHTML($body);
$mail->AltBody = $alt;
$mail->AddAddress($email, $email);
echo " $email <br/> ";
if(!$mail->Send()) {
throw new Exception($mail->ErrorInfo);
}
}
catch(Exception $e){
echo $e->getMessage();
}
-------------------------- End PHP Code --------------------------
//-------------------------- OutPut -------------------------//
[email protected]
SMTP -> FROM SERVER:
SMTP -> NOTICE: EOF caught while checking if connected
Warning: fputs() expects parameter 1 to be resource, integer given
[email protected]
SMTP -> FROM SERVER:220 smtp113.biz.mail.mud.yahoo.com ESMTP
SMTP -> FROM SERVER: 250-smtp113.biz.mail.mud.yahoo.com 250-AUTH LOGIN PLAIN XYMCOOKIE 250-PIPELINING 250 8BITMIME
SMTP -> FROM SERVER:250 OK , completed
SMTP -> FROM SERVER:250 OK , completed
SMTP -> FROM SERVER:354 Start Mail. End with CRLF.CRLF
SMTP -> FROM SERVER:250 OK , completed
Message: "Hey! I saw you this Friday outside of the 2 for 1 sales dept. The ad's we put up together look good! The manager wants to meet with us to discuss the new marketing strategy. What is your opinion of the ad campaign?"
-------------------------- PHP Code --------------------------
try {
$mail = new PHPMailer(true);
$mail->IsSMTP();
$mail->SMTPSecure = 'ssl';
$mail->SMTPAuth = true;
$mail->Host = SMTP_SERVER;
$mail->Port = SMTP_PORT;
$mail->Username = SMTP_USERNAME;
$mail->Password = SMTP_PASSWORD;
$mail->SMTPDebug = 2;
$mail->SetFrom(MAIL_ORDERS_ADDRESS, 'MsPotato');
$mail->Subject = 'Mr Potato Please!';
$mail->MsgHTML($body);
$mail->AltBody = $alt;
$mail->AddAddress($email, $email);
echo " $email <br/> ";
if(!$mail->Send()) {
throw new Exception($mail->ErrorInfo);
}
}
catch(Exception $e){
echo $e->getMessage();
}
-------------------------- End PHP Code --------------------------
//-------------------------- OutPut -------------------------//
[email protected]
SMTP -> FROM SERVER:
SMTP -> NOTICE: EOF caught while checking if connected
Warning: fputs() expects parameter 1 to be resource, integer given
[email protected]
SMTP -> FROM SERVER:220 smtp113.biz.mail.mud.yahoo.com ESMTP
SMTP -> FROM SERVER: 250-smtp113.biz.mail.mud.yahoo.com 250-AUTH LOGIN PLAIN XYMCOOKIE 250-PIPELINING 250 8BITMIME
SMTP -> FROM SERVER:250 OK , completed
SMTP -> FROM SERVER:250 OK , completed
SMTP -> FROM SERVER:354 Start Mail. End with CRLF.CRLF
SMTP -> FROM SERVER:250 OK , completed