Can't get PHPMailer working [duplicate]

☆樱花仙子☆ 提交于 2019-12-02 00:18:07
Louis

I have this code running :

//      PHPmailer

require 'PHPMailer-master/PHPMailerAutoload.php';

$mail = new PHPMailer;
$mail->CharSet = 'UTF-8';
$mail->isSMTP();                            // Set mailer to use SMTP
$mail->Host = SMTP;                         // Specify main and backup SMTP servers/*

$mail->From = EMAIL;
$mail->FromName = SENDER;
$mail->addAddress($Email, $FirstName);      // Add a recipient
$mail->WordWrap = 50;                       // Set word wrap to 50 characters
$mail->isHTML(true);                        // Set email format to HTML

$mail->Subject = $mailSubject;
$mail->Body    = $message;

if(!$mail->send()) {
    echo 'Message could not be sent.';
    echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
    echo 'Message has been sent to ' . $Email . "<br>";
} 

//      end of PHPmailer

with structure :

PHPMailer-Master
-class.phpmailer.php
-class.pop3.php
-class.smtp.php
-PHPmailerAutoload.php
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!