Click here to Skip to main content
15,888,301 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi there, I try to send email using PHPMailer, here my code:

PHP
require '/****/*****/******/PHPMailer-master/PHPMailerAutoload.php';
$mailltoadm = new PHPMailer;
$mailltoadm->isSMTP();     // Set mailer to use SMTP
$mailltoadm->Host = 'localhost';  // Specify main and backup SMTP servers
$mailltoadm->SMTPAuth = true;     // Enable SMTP authentication
$mailltoadm->Username = '******@*******.com';  // SMTP username
$mailltoadm->Password = '*******';   // SMTP password
$mailltoadm->SMTPSecure = 'tls';  // Enable encryption, 'ssl' also accepted
$mailltoadm->From = $emaillogin;             //EMAIL PENGIRIM
$mailltoadm->FromName = $userloginname;      //NAMA PENGIRIM
$mailltoadm->addAddress($mastermaill, $name_store); // Add a recipient (PENERIMA)
$mailltoadm->addAddress($mastermaill);  
$mailltoadm->addReplyTo($emaillogin, $userloginname);
$mailltoadm->WordWrap = 50;  // Set word wrap to 50 characters
$mailltoadm->isHTML(true);    // Set email format to HTML
$mailltoadm->Subject = 'New Order '. $name_store;
$mailltoadm->Body    = $finishorder;   //HTML SUPPORT
$mailltoadm->AltBody = convert_html_to_text($finishorder);  //NON HTML
if(!$mailltoadm->send()) 
{
   echo 'Mailer to admin Error: ' . $mailltoadm->ErrorInfo."<br/>";
} 
else 
{
   echo 'Message to admin has been sent'."<br/>";
}


why email send to ***@yahoo.com success, but not send to ***@gmail.com ?
can any one help me please.
Posted
Comments
Do you see any errors or exceptions?
bagus bujangga 18-May-14 10:21am    
no error or exceptions show. just show up "Message to admin has been sent".

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900