0

I am getting this error (phplist email not sending [email protected] : Called Mail() without being connected) since upgrading my phplist nothing else has change I have sent a test email from the actual smtp mail box and it works so I know it not the email address I think it must be somthing in my config.php file but cants seem to find what could be causing the issue any help would be great please see my config.php i Have put on pastbin as its to big put here http://pastebin.com/CjRKdu5H

1
  • Also I have just removed the SMTP and it works sending from the php standard mail but my hosting will not let us send marketing emails this way Aug 22, 2014 at 9:58

1 Answer 1

0
 <?php

 require("PHPMailer/class.phpmailer.php");
    $mail = new PHPMailer();  // create a new object
    $mail->IsSMTP(); // enable SMTP
    $mail->SMTPDebug = 0;  // debugging: 1 = errors and messages, 2 = messages only
    $mail->SMTPAuth = true;  // authentication enabled
    $mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail 
    //if  $mail->SMTPSecure = 'tls';
    // use $mail->Port = 465; 
    $mail->Host = 'smtp.gmail.com';
    $mail->Port = 465; 
    $mail->Username = 'username';  
    $mail->Password = 'password';           
    $mail->SetFrom('[email protected]', 'Testing');
    $mail->Subject = 'Yii Test';
    $mail->Body = "hello";
    $mail->AddAddress('[email protected]');
    if(!$mail->Send()) {
        $error = 'Mail error: '.$mail->ErrorInfo; 
        return false;
    } else {
        echo $error = 'Message sent!';
        return true;
    }
?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.