SMTP无法使用php邮件程序类

我有两个帐户:

no-reply@weddinggrabs.com
no-reply@appovio.com

传入POP3:pop.secureserver.net(995)
传出SMTP:smtpout.secureserver.net(80,3535,25,465)

这些工作使用电子邮件客户端,如Thunderbird,post-box等,但不使用php-mailer:

        error_reporting(0);
        require_once ("class.phpmailer.php");// PHP MAILER FOR SENDING EMAILS

        $mail = new PHPMailer();

        define('EMAIL_HOST','smtpout.secureserver.net');
        define('EMAIL_USER','no-reply@weddinggrabs.com');
        define('EMAIL_PASSWORD','xxxxxxxx');

        $mail->IsSMTP();                    
        $mail->Port     = 465;              
        $mail->Host     = EMAIL_HOST;       
        $mail->Username = EMAIL_USER;       
        $mail->Password = EMAIL_PASSWORD;   
        $mail->SMTPAuth = true;             

        $mail->FromName = "Administrator";
        $mail->From = "Administrator";
        $mail->AddAddress($email); 
        $mail->WordWrap = 50;   
        $mail->IsHTML(true);    
        $mail->Subject  = "Seating Arrangements on Event";
        $mail->Body     = "Dear WeddingWire Customer";

        if($mail->Send()) return "true";        

        return  "false";

解决方法:

你试过$mail-> SMTPSecure =’ssl’?一些SMTP服务器需要这个.

使用$mail->错误信息检查错误有时给出提示.

上一篇:静态综合实验


下一篇:使用PHPMailer发送unicode表情符号