Jump to content

syntax error, unexpected '@' in C:\wamp\www\PHPMailer_5.2.4\examples\mail1.php on line 17


shwetapandit

Recommended Posts

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 = "[email protected]";
$mail->Password = "abcabc";
$mail->SetFrom('[email protected]');
$mail->Subject = "Test";
$mail->Body = "hello";
$mail->AddAddress([email protected],'abcabc');
 if(!$mail->Send())
    {
    echo "Mailer Error: " . $mail->ErrorInfo;
    }
    else
    {
    echo "Message has been sent";
    }

?>

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:[email protected] : Called Mail() without being connected Mailer Error: The following From address failed: [email protected] : 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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.