2014-05-01 142 views
2

首先,我想说我不太了解smtp电子邮件php_mail的东西。我使用电子邮件插件来使用smtp邮件。我配置了我的smtp选项,然后用测试函数测试了电子邮件。使用WordPress通过SMTP发送邮件?

有日志:

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) "[email protected]" 
    ["FromName"]=> 
    string(16) "Taze Dizi Destek" 
    ["Sender"]=> 
    string(0) "" 
    ["ReturnPath"]=> 
    string(0) "" 
    ["Subject"]=> 
    string(47) "WP Mail SMTP: Test mail to [email protected]" 
    ["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: [email protected] 
From: Taze Dizi Destek 
Message-ID: <[email protected]> 
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: [email protected] 
    Subject: WP Mail SMTP: Test mail to [email protected] 
"  
    ["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) "[email protected]" 
     [1]=> 
     string(0) "" 
    } 
    } 
    ["cc":protected]=> 
    array(0) { 
    } 
    ["bcc":protected]=> 
    array(0) { 
    } 
    ["ReplyTo":protected]=> 
    array(0) { 
    } 
    ["all_recipients":protected]=> 
    array(1) { 
    ["[email protected]"]=> 
    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) 
} 

我的配置:

FROMA邮件:[email protected]

从名称:Site Name

使用:Send all WordPress emails via SMTP

SMTP主机:smtp.gmail.com

SMTP端口:465

加密:USE SSL Encryption

AUTHENT。 :Use SMTP authentication

用户名:[email protected]

密码:[email protected]'s password

我在哪里做错了。希望您能够帮助我。

+0

可能重复gmail smtp](http://stackoverflow.com/questions/18813804/php-send-email-using-gmail-smtp) – cpilko

+0

我不写邮件发送代码。我正在使用插件。如果有设置(代码)需要添加,我可以,但问题是不同的。请仔细比较这个问题。 – fthopkins

+0

对不起,欢迎来到Stack Overflow。这是一个关于*编程*问题的网站。如果你有插件问题,你应该在[插件的支持论坛。](http://wordpress.org/support/plugin/webriti-smtp-mail)上解决这个问题。 – cpilko

回答

5

也许不使用你的插件,你可以用PHP来做。

添加到您的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

1卸载所有SMTP插件 2-安装以下插件:电子邮件返回路径头修复的[PHP的使用发送电子邮件

+0

使用评论。这不是一个答案 –