douzhanrun0497 2014-05-01 16:53
浏览 166
已采纳

使用WordPress通过SMTP发送邮件?

First of all i want to say i dont know much about the smtp email php_mail things. I'm using email plugin to use smtp mail. I configured my smtp options then tested email with test function.

There is the log:

Test Message Sent
The result was:
bool(true)
The full debugging output is shown below:
object(PHPMailer)#4817 (65) {
  ["Priority"]=>
  int(3)
  ["CharSet"]=>
  string(5) "UTF-8"
  ["ContentType"]=>
  string(10) "text/plain"
  ["Encoding"]=>
  string(4) "8bit"
  ["ErrorInfo"]=>
  string(0) ""
  ["From"]=>
  string(24) "destektazedizi@gmail.com"
  ["FromName"]=>
  string(16) "Taze Dizi Destek"
  ["Sender"]=>
  string(0) ""
  ["ReturnPath"]=>
  string(0) ""
  ["Subject"]=>
  string(47) "WP Mail SMTP: Test mail to farukest90@gmail.com"
  ["Body"]=>
  string(68) "This is a test email generated by the WP Mail SMTP WordPress plugin."
  ["AltBody"]=>
  string(0) ""
  ["MIMEBody":protected]=>
 string(69) "This is a test email generated by the WP Mail SMTP WordPress plugin.
"
  ["MIMEHeader":protected]=>
  string(377) "Date: Thu, 1 May 2014 16:35:44 +0000
Return-Path: destektazedizi@gmail.com
From: Taze Dizi Destek 
Message-ID: <590991a14f48ccff103ebaef7f3a0ac8@www.tazedizi.com>
X-Priority: 3
X-Mailer: PHPMailer 5.2.4 (http://code.google.com/a/apache-extras.org/p/phpmailer/)
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=UTF-8
"
  ["mailHeader":protected]=>
  string(82) "To: farukest90@gmail.com
    Subject: WP Mail SMTP: Test mail to farukest90@gmail.com
"    
  ["WordWrap"]=>
  int(0)
  ["Mailer"]=>
  string(4) "mail"
  ["Sendmail"]=>
  string(18) "/usr/sbin/sendmail"
      ["UseSendmailOptions"]=>
  bool(true)
  ["PluginDir"]=>
  string(0) ""
  ["ConfirmReadingTo"]=>
  string(0) ""
  ["Hostname"]=>
  string(0) ""
     ["MessageID"]=>
  string(0) ""
  ["MessageDate"]=>
  string(0) ""
  ["Host"]=>
  string(9) "localhost"
  ["Port"]=>
  int(25)
  ["Helo"]=>
  string(0) ""
  ["SMTPSecure"]=>
  string(3) "ssl"
  ["SMTPAuth"]=>
  bool(false)
  ["Username"]=>
  string(0) ""
  ["Password"]=>
  string(0) ""
  ["AuthType"]=>
  string(0) ""
  ["Realm"]=>
  string(0) ""
  ["Workstation"]=>
  string(0) ""
  ["Timeout"]=>
  int(10)
  ["SMTPDebug"]=>
  bool(true)
  ["Debugoutput"]=>
  string(4) "echo"
  ["SMTPKeepAlive"]=>
  bool(false)
  ["SingleTo"]=>
  bool(false)
  ["SingleToArray"]=>
  array(0) {
  }
  ["LE"]=>
      string(1) "
"
  ["DKIM_selector"]=>
  string(0) ""
  ["DKIM_identity"]=>
  string(0) ""
  ["DKIM_passphrase"]=>
  string(0) ""
  ["DKIM_domain"]=>
  string(0) ""
  ["DKIM_private"]=>
  string(0) ""
 ["action_function"]=>
  string(0) ""
  ["Version"]=>
  string(5) "5.2.4"
  ["XMailer"]=>
  string(0) ""
  ["smtp":protected]=>
  NULL
  ["to":protected]=>
  array(1) {
    [0]=>
    array(2) {
      [0]=>
      string(20) "farukest90@gmail.com"
      [1]=>
      string(0) ""
    }
  }
  ["cc":protected]=>
  array(0) {
  }
  ["bcc":protected]=>
  array(0) {
  }
  ["ReplyTo":protected]=>
  array(0) {
  }
  ["all_recipients":protected]=>
  array(1) {
    ["farukest90@gmail.com"]=>
    bool(true)
  }
  ["attachment":protected]=>
      array(0) {
  }
  ["CustomHeader":protected]=>
  array(0) {
  }
  ["message_type":protected]=>
  string(5) "plain"
  ["boundary":protected]=>
  array(3) {
    [1]=>
    string(35) "b1_590991a14f48ccff103ebaef7f3a0ac8"
    [2]=>
    string(35) "b2_590991a14f48ccff103ebaef7f3a0ac8"
    [3]=>
    string(35) "b3_590991a14f48ccff103ebaef7f3a0ac8"
  }
  ["language":protected]=>
  array(0) {
  }
  ["error_count":protected]=>
  int(0)
  ["sign_cert_file":protected]=>
  string(0) ""
  ["sign_key_file":protected]=>
  string(0) ""
  ["sign_key_pass":protected]=>
  string(0) ""
  ["exceptions":protected]=>
   bool(true)
}

My configuration :

Froma Mail : mymail@gmail.com

From Name : Site Name

Using : Send all WordPress emails via SMTP

Smtp Host : smtp.gmail.com

Smtp Port : 465

Encryption : USE SSL Encryption

Authent. : Use SMTP authentication

Username : mymail@gmail.com

Password : mymail@gmail's password

Where am i doing wrong. Hope you can help me.

  • 写回答

2条回答 默认 最新

  • drblhw5731 2014-05-01 17:15
    关注

    Maybe instead of using your plugin you could do it with PHP.

    Add this to your functions.php:

    add_action( 'phpmailer_init', 'my_phpmailer_init' );
    function my_phpmailer_init( PHPMailer $phpmailer ) {
        $phpmailer->Host = 'smtp.yourSMTPhost.net';
        $phpmailer->Port = 465; // could be different
        $phpmailer->Username = 'YOURUSERNAME'; // if required
        $phpmailer->Password = 'YOURPASSWORD'; // if required
        $phpmailer->SMTPAuth = true; // if required
        $phpmailer->SMTPSecure = 'ssl'; // enable if required, 'tls' is another possible value
        $phpmailer->IsSMTP();
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能