shwetapandit Posted October 23, 2013 Share Posted October 23, 2013 i am in great need to solve this.i received the error as Mailer Error: The following From address failed: [email protected] : Called Mail() without being connected when try to execute my mailform.php script.any help is greatly appreciated. i change the requires settings in php.ini as SMTP = PHP_INI_ALLsmtp_port = smtp.gmail.comsendmail_from = PHP_INI_ALL the script is: <?phprequire("PHPMailer_5.2.4/class.phpmailer.php");$mail = new PHPMailer();$mail->IsSMTP(); // telling the class to use SMTP$mail->SMTPAuth = true; // SMTP authentication$mail->Host = "smtp.gmail.com";$mail->SMTPSecure = "tls";$mail->Port = 587; // SMTP Port$mail->SMTPDebug = 2; // 2 to enable SMTP debug information$mail->Username = "[email protected]"; // SMTP account username$mail->Password = "*******"; // SMTP account password$mail->SetFrom($email, $name); // FROM$mail->AddAddress('[email protected]'); // recipient email$mail->Subject = "Website- Contact Form"; // email subject$mail->Body = $msg;$mail->Send();if($mail->IsError()) //if(!$mail->Send()){ echo 'Message was not sent.'; echo 'Mailer errors: ' . $mail->ErrorInfo;}else{ echo "Thank you ";}?> Link to comment https://forums.phpfreaks.com/topic/283203-mailer-error-the-following-from-address-failed-usernamegmailcom-called-mail-without-being-connected/ Share on other sites More sharing options...
shwetapandit Posted October 23, 2013 Author Share Posted October 23, 2013 get solved. Link to comment https://forums.phpfreaks.com/topic/283203-mailer-error-the-following-from-address-failed-usernamegmailcom-called-mail-without-being-connected/#findComment-1455066 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.