I try to send email using PHPMailer, here my code:
require '/PHPMailer-master/PHPMailerAutoload.php';
$mailltoadm = new PHPMailer;
$mailltoadm->isSMTP();
$mailltoadm->Host = 'localhost';
$mailltoadm->SMTPAuth = true;
$mailltoadm->Username = 'admin@queenshifa.com';
$mailltoadm->Password = 'mypasswordhere';
$mailltoadm->SMTPSecure = 'tls';
$mailltoadm->From = $emaillogin;
$mailltoadm->FromName = $userloginname;
$mailltoadm->addAddress($mastermaill, $name_store);
$mailltoadm->addAddress($mastermaill);
$mailltoadm->addReplyTo($emaillogin, $userloginname);
$mailltoadm->WordWrap = 50;
$mailltoadm->isHTML(true);
$mailltoadm->Subject = 'New Order '. $name_store;
$mailltoadm->Body = $finishorder;
$mailltoadm->AltBody = convert_html_to_text($finishorder);
if(!$mailltoadm->send())
{
echo 'Mailer to admin Error: ' . $mailltoadm->ErrorInfo;
}
else
{
echo 'Message to admin has been sent';
}
Why email send to @yahoo.com success, but not send to @gmail.com ?
can any one help me please.
If you can really receive emails on @yahoo and don't have them @gmail it simple means that Google blocks your emails. You should definitely check your spam folder on Gmail because your emails probably are there.