2015-04-06 114 views
1

所以這是我第一次問這裏。我一直在嘗試爲我公司的Testlink啓用任何SMTP。但是,我無法弄清楚爲什麼我不能在8小時前完成工作。一直花我的辦公時間試圖解決這個問題,並在那裏搜索,但可悲的是,似乎沒有任何解決方案適用於我。如果有人可以請修改我的代碼,我很樂意爲您提供幫助。將Testlink連接到Gmail SMTP

的錯誤主要是關於:

SMTP -> FROM SERVER: 
 
SMTP -> FROM SERVER: 
 
SMTP -> ERROR: EHLO not accepted from server: 
 
SMTP -> FROM SERVER: 
 
SMTP -> ERROR: HELO not accepted from server: 
 
SMTP -> ERROR: AUTH not accepted from server: 
 
SMTP -> NOTICE: EOF caught while checking if connectedSMTP Error: Could not authenticate. PROBLEMS SENDING MAIL TO: [email protected] 
 
Mailer Error: SMTP Error: Could not authenticate.

而且大部分顯示它不能加載TLS字符串的時間。

這裏是我的config.inc.php文件:

/* [SMTP] */ 
 

 
/** 
 
* @var string SMTP server name or IP address ("localhost" should work in the most cases) 
 
* Configure using custom_config.inc.php 
 
* @uses lib/functions/email_api.php 
 
*/ 
 

 

 
// SMTP server Configuration ("localhost" is enough in the most cases) 
 
$g_smtp_host  = 'smtp.gmail.com:465'; # SMTP server MUST BE configured 
 

 
# Configure using custom_config.inc.php 
 
$g_tl_admin_email  = '[email protected]'; # for problem/error notification 
 
$g_from_email   = '[email protected]'; # email sender 
 
$g_return_path_email = '[email protected]'; 
 

 
# Urgent = 1, Not Urgent = 5, Disable = 0 
 
$g_mail_priority = 5; 
 

 
/** 
 
* Taken from mantis for phpmailer config 
 
* select the method to mail by: 
 
* PHPMAILER_METHOD_MAIL - mail() 
 
* PHPMAILER_METHOD_SENDMAIL - sendmail 
 
* PHPMAILER_METHOD_SMTP - SMTP 
 
*/ 
 
$g_phpMailer_method = PHPMAILER_METHOD_SMTP; 
 

 
/** Configure only if SMTP server requires authentication */ 
 
$g_smtp_username = '[email protected]'; # user 
 
$g_smtp_password = 'xxxxxxxx'; # password 
 

 
/** 
 
* This control the connection mode to SMTP server. 
 
* Can be '', 'ssl','tls' 
 
* @global string $g_smtp_connection_mode 
 
*/ 
 
$g_smtp_connection_mode = ''; 
 

 
/** 
 
* The smtp port to use. The typical SMTP ports are 25 and 587. The port to use 
 
* will depend on the SMTP server configuration and hence others may be used. 
 
* @global int $g_smtp_port 
 
*/ 
 
$g_smtp_port = 465;

class.phpmailer.php文件:

/** 
 
    * Sets the Sender email (Return-Path) of the message. If not empty, 
 
    * will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode. 
 
    * @var string 
 
    */ 
 
    public $Sender   = '[email protected]'; 
 

 
    /** 
 
    * Sets the Subject of the message. 
 
    * @var string 
 
    */ 
 
    public $Subject   = ''; 
 

 
    /** 
 
    * Sets the Body of the message. This can be either an HTML or text body. 
 
    * If HTML then run IsHTML(true). 
 
    * @var string 
 
    */ 
 
    public $Body    = ''; 
 

 
    /** 
 
    * Sets the text-only body of the message. This automatically sets the 
 
    * email to multipart/alternative. This body can be read by mail 
 
    * clients that do not have HTML email capability such as mutt. Clients 
 
    * that can read HTML will view the normal Body. 
 
    * @var string 
 
    */ 
 
    public $AltBody   = ''; 
 

 
    /** 
 
    * Sets word wrapping on the body of the message to a given number of 
 
    * characters. 
 
    * @var int 
 
    */ 
 
    public $WordWrap   = 0; 
 

 
    /** 
 
    * Method to send mail: ("mail", "sendmail", or "smtp"). 
 
    * @var string 
 
    */ 
 
    public $Mailer   = 'smtp'; 
 

 
    /** 
 
    * Sets the path of the sendmail program. 
 
    * @var string 
 
    */ 
 
    public $Sendmail   = '/usr/sbin/sendmail'; 
 

 
    /** 
 
    * Path to PHPMailer plugins. Useful if the SMTP class 
 
    * is in a different directory than the PHP include path. 
 
    * @var string 
 
    */ 
 
    public $PluginDir   = ''; 
 

 
    /** 
 
    * Sets the email address that a reading confirmation will be sent. 
 
    * @var string 
 
    */ 
 
    public $ConfirmReadingTo = '[email protected]'; 
 

 
    /** 
 
    * Sets the hostname to use in Message-Id and Received headers 
 
    * and as default HELO string. If empty, the value returned 
 
    * by SERVER_NAME is used or 'localhost.localdomain'. 
 
    * @var string 
 
    */ 
 
    public $Hostname   = ''; 
 

 
    /** 
 
    * Sets the message ID to be used in the Message-Id header. 
 
    * If empty, a unique id will be generated. 
 
    * @var string 
 
    */ 
 
    public $MessageID   = ''; 
 

 
    ///////////////////////////////////////////////// 
 
    // PROPERTIES FOR SMTP 
 
    ///////////////////////////////////////////////// 
 

 
    /** 
 
    * Sets the SMTP hosts. All hosts must be separated by a 
 
    * semicolon. You can also specify a different port 
 
    * for each host by using this format: [hostname:port] 
 
    * (e.g. "smtp1.example.com:25;smtp2.example.com"). 
 
    * Hosts will be tried in order. 
 
    * @var string 
 
    */ 
 
    public $Host   = 'smtp.gmail.com:465'; 
 

 
    /** 
 
    * Sets the default SMTP server port. 
 
    * @var int 
 
    */ 
 
    public $Port   = 465; 
 

 
    /** 
 
    * Sets the SMTP HELO of the message (Default is $Hostname). 
 
    * @var string 
 
    */ 
 
    public $Helo   = 'Hi from Admin Testlink'; 
 

 
    /** 
 
    * Sets connection prefix. 
 
    * Options are "", "ssl" or "tls" 
 
    * @var string 
 
    */ 
 
    // public $SMTPSecure = 'tls'; 
 

 
    /** 
 
    * Sets SMTP authentication. Utilizes the Username and Password variables. 
 
    * @var bool 
 
    */ 
 
    public $SMTPAuth  = true; 
 

 
    /** 
 
    * Sets SMTP username. 
 
    * @var string 
 
    */ 
 
    public $Username  = '[email protected]'; 
 

 
    /** 
 
    * Sets SMTP password. 
 
    * @var string 
 
    */ 
 
    public $Password  = 'xxxxx'; 
 

 
    /** 
 
    * Sets the SMTP server timeout in seconds. 
 
    * This function will not work with the win32 version. 
 
    * @var int 
 
    */ 
 
    public $Timeout  = 10; 
 

 
    /** 
 
    * Sets SMTP class debugging on or off. 
 
    * @var bool 
 
    */ 
 
    public $SMTPDebug  = true; 
 

 
    /**

請幫我如果你的免費!謝謝。

回答

2

改變config.inc.php文件

以下行來源:

$g_smtp_host  = 'smtp.gmail.com:465'; 

要:

$g_smtp_host  = 'smtp.gmail.com'; 

和嘗試。

我有更少的stackoverflow聲譽來評論你的問題,所以只發布它作爲答案。