shwetapandit Posted August 29, 2013 Share Posted August 29, 2013 why it gives me error like this:syntax error, unexpected '@' in C:\wamp\www\PHPMailer_5.2.4\examples\mail1.php on line 17 the snippet are as:suggest me any solution........... <?php require_once "C:\wamp\www\PHPMailer_5.2.4/class.phpmailer.php";$mail = new PHPMailer();$mail->IsSMTP();$mail->IsSMTP(); // enable SMTP$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only$mail->SMTPAuth = true; // authentication enabled$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail$mail->Host = "smtp.gmail.com";$mail->Port = 465; // or 587$mail->IsHTML(true);$mail->Username = "abcabc@gmail.com";$mail->Password = "abcabc";$mail->SetFrom('ab@gmail.com');$mail->Subject = "Test";$mail->Body = "hello";$mail->AddAddress(abcd@gmail.com,'abcabc'); if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message has been sent"; }?> Quote Link to comment Share on other sites More sharing options...
PravinS Posted August 29, 2013 Share Posted August 29, 2013 check this line $mail->AddAddress(abcd@gmail.com,'abcabc'); use quotes around email address Quote Link to comment Share on other sites More sharing options...
shwetapandit Posted August 29, 2013 Author Share Posted August 29, 2013 if i m quoting it as u say then it gives:SMTP -> ERROR: Failed to connect to server: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (54497120)The following From address failed:abcabc@gmail.com : Called Mail() without being connected Mailer Error: The following From address failed: abab@gmail.com : Called Mail() without being connected Is there any settings for ssl in php.ini. i have only single line about ssl in php.ini that is extension=php_openssl.dll what's problen exacltly i check various sites and blogs but find no solutions. Quote Link to comment Share on other sites More sharing options...
PravinS Posted August 29, 2013 Share Posted August 29, 2013 (edited) your SMTP connection is not working, try telnet from your server telnet smtp.gmail.com 587 telnet smtp.gmail.com 465 Edited August 29, 2013 by PravinS Quote Link to comment Share on other sites More sharing options...
shwetapandit Posted August 29, 2013 Author Share Posted August 29, 2013 where to set this telnet command in php.ini or in cmd prompt thanks for your help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.