phpMailer没有发送没有错误的电子邮件

时间:2016-09-02 21:05:31

标签: phpmailer

我遇到有关使用phpMailer发送电子邮件的问题 我的代码是

 public function sendEmailNovoUtilizador($nome, $email){
    $mail = new PHPMailer;
    $mail->SMTPDebug = 1;
    $mail->isSMTP();
    $mail->Host = 'xxxxx.xxxxxxx.pt';
    $mail->SMTPAuth = true;
    $mail->Username = 'xxxxxxx@xxxxxx.edu.pt';
    $mail->Password = 'xxxxxxx';
    $mail->SMTPSecure = 'tls';
    $mail->Port = 587;
    $mail->setFrom('xxxxxxx@xxxxxx.edu.pt', 'Diretor');
    $mail->addAddress($email, 'Novo utilizador');
    $mail->IsHTML(true);
    $mail->Subject = 'Registo de um novo utilizador';
    $mail->CharSet = 'UTF-8';
    $mail->Body = "
        <html>
        <head>
            <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
        </head>
        <body>
            <h1>Novo Utilizador</h1>
            <p>Seguem os seus dados</p>
            <table>
            <tbody>
            <tr>
            <td><strong>Nome:</strong></td>
            <td>$nome</td>
            </tr>
            <tr>
            <td><strong>Email:</strong></td>
            <td>$email</td>
            </tr>
            </tbody>
            </table>
            <p>&nbsp;</p>
            <p>Aguarde a validação por parte do Diretor</p>
            <p>&nbsp;</p>
            <p>Equipa ESMAIOR.</p>
            <p>&nbsp;</p>
            <p>Obrigado</p>
            </body>
            </html>";
    $mail->addAttachment('../img/logo_pdf.jpg');
    if (!$mail->send()) {
        echo "Mailer Error: " . $mail->ErrorInfo;
    }
}

登录我的服务器时出现错误

    Delivery Event Details
Event: failure
User: ebspma
Domain: xxxx.edu.pt
Sender: xxxxxx@xxxx.edu.pt
Sent Time: Sep 2, 2016 10:56:22 PM
Sender Host: xxxxxx.edu.pt
Sender IP: 109.71.40.19
Authentication: dovecot_login
Spam Score: 0
Recipient: xxxxxxx@gmail.com
Delivery User:
Delivery
Domain:
Delivered To:
Router: smarthost_cleanmx_regular
Transport: remote_smtp_cleanmx_smart_regular
Out Time: Sep 2, 2016 10:56:22 PM
ID: 1bfwS2­002VOU­Q4
Delivery Host: smtp.cleanmx.pt
Delivery IP: 130.185.80.200
Size: 6.52 KB
Result:
DHE­RSA­AES256­SHA:256 CV=yes DN="/OU=Domain Control
Validated/CN=*.cleanmx.pt": SMTP error from remote mail server after MAIL FROM:
<xxxxxx@xxxxx.edu.pt> SIZE=7818: 550­ Verification failed for
<xxxxxx@xxxx.edu.pt>\n550­Previous (

出了什么问题,似乎连接但无法发送?这是我从服务器登录电子邮件中获得的内容

0 个答案:

没有答案