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 = "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";
    }

?>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.