Devil May Code...

Vergil's Blog

今天在使用phpmailer smtp发送QQ邮箱的邮件时遇到些问题,在此记录一下:

QQ的发送邮件服务器:smtp.qq.com,使用SSL,端口号465或587
而且需要使用独立密码
代码如下:

$mailer = PHPMailer();
$mailer->IsSMTP();
$mailer->SMTPAuth = true;
$mailer->SMTPSecure = 'ssl';
$mailer->Password = 'QQ邮箱独立密码';
//...其他配置省略

已有 14 条评论 »

  1. You are my inhalation, I have few web logs and rarely run out from post

  2. Ive learn some excellent stuff here. Certainly worth bookmarking for revisiting. I wonder how a lot attempt you set to create such a fantastic informative web site.

  3. Someone essentially help to make seriously posts I would state. This is the very first time I frequented your web page and thus far? I surprised with the research you made to make this particular publish incredible. Magnificent job!

  4. Thanks for the sensible critique. Me & my neighbor were just preparing to do a little research about this. We got a grab a book from our area library but I think I learned more clear from this post. I am very glad to see such wonderful info being shared freely out there.

  5. I feel like Im regularly seeking interesting features you just read about a number of subjects, but I handle to add in the blog among our translates every day when you

  6. I usually do not drop a comment, but I read a few

  7. I usually do not drop a comment, but I read a few

  8. Article Source a viral game app is not that much difficult.

  9. I genuinely enjoy studying on this website, it holds good content. Never fight an inanimate object. by P. J. O'Rourke.

  10. Hello!

  11. Hello!

  12. Aw, this was a very nice post. In thought I want to put in writing like this moreover taking time and actual effort to make an excellent article but what can I say I procrastinate alot and not at all seem to get something done. kacbfedddddddeea

  13. Rhode Rhode

    能否给出你的配置代码,我也是PHPMailer, sll,465,username=909235815,密码2个都试过,都不行。

    $Mail = new PHPMailer();

    $Mail->IsSMTP(); // Use SMTP
    $Mail->Host =“smtp.qq.com”; // Sets SMTP server
    $Mail->SMTPDebug = 2; // 2 to enable SMTP debug information
    $Mail->SMTPAuth = TRUE; // enable SMTP authentication
    $Mail->SMTPSecure = "ssl"; //Secure conection
    $Mail->Port = $portnumber; // set the SMTP port
    $Mail->Username = "909235815"; // SMTP account username
    $Mail->Password = "独立密码"; // SMTP account password
    $Mail->Priority = 1; // Highest priority - Email priority (1 = High, 3 = Normal, 5 = low)
    $Mail->CharSet = 'UTF-8';
    $Mail->Encoding = '8bit';
    $Mail->Subject = 'Test Email Using Gmail';
    $Mail->ContentType = 'text/html; charset=utf-8\r\n';
    $Mail->From = $mymail;
    $Mail->FromName = 'GMail Test';
    $Mail->WordWrap = 50; // RFC 2822 Compliant for Max 998 characters per line

    $Mail->AddAddress( "909235815@qq.com"); // To:
    $Mail->isHTML( TRUE );
    $Mail->Body = $mailbody;
    $Mail->AltBody = $mailbody;
    $Mail->Send();

    1. Rhode Rhode

      $mymail="mail body";
      $mailbody="this is the body of an email"

评论已关闭

Powered by Typecho.