We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33085
    • 11 Posts
    I’m not able to use smpt...

    Example:
    include_once($modx->config['base_path'].'manager/includes/controls/class.phpmailer.php');
    
    $mail = new PHPMailer();
    
    $mail->IsSMTP();                            // set mailer to use SMTP
    $mail->Host = "smtp.mydomain.it";        // specify main and backup server
    $mail->SMTPAuth = true;                        // turn on SMTP authentication
    $mail->Username = "[email protected]";;    // SMTP username
    $mail->Password = "mypassword";            // SMTP password
    
    $mail->From = "[email protected]";    //do NOT fake header.
    $mail->FromName = "MailMan";
    $mail->AddAddress("[email protected]");
    $mail->AddReplyTo("[email protected]", "Support and Help"); //optional
    
    $mail->Subject = "Just a Test";
    $mail->Body    = "Hello. I am testing PHP Mailer.";
    
    if(!$mail->Send())
    {
       echo $mail->ErrorInfo;
    }else{
       echo "email was sent";
    }
    


    Modx (class.phpmailer.php) don’t realy use SMTP... Because if I put wrong data I recive a mail anyway...

    Can anyone help me in writing the short code
    Thanks