TestLink學習三:發送郵件的兩種配置方法


第一種:修改config.inc.php中的[smtp],配置為默認本地發送,用hotmail用戶做接收,調試成功!(本人未嘗試這種

// ----------------------------------------------------------------------------
/** [SMTP] */

// Developer Note:
// these config variable names has been choosed to maintain compatibility
// with code taken from Mantis.
// 
// SMTP server Configuration ("localhost" is enough in the most cases)

 $g_tl_admin_email = 'tl_admin@127.0.0.1';#按此配置即可
 $g_from_email = 'testlink_system@127.0.0.1';#按此配置即可
 $g_return_path_email = 'no_replay@127.0.0.1';#按此配置即可
 //
 # Urgent = 1, Not Urgent = 5, Disable = 0
 $g_mail_priority = 5;

 //
 # Taken from mantis for phpmailer config
 //define ("SMTP_SEND",2);
 //$g_phpMailer_method = SMTP_SEND;

//
 // SMTP Configuration
 $g_smtp_host = 'localhost'; # SMTP server
 //
 // Configure only if SMTP server requires
 $g_smtp_username = ''; # user
 $g_smtp_password = ''; # password

// ----------------------------------------------------------------------------

 

第二種:修改config.inc.php中的[smtp],配置為公司郵箱發送,用我公司郵箱調試成功!(本人調試成功

// ----------------------------------------------------------------------------
/** [SMTP] */

// Developer Note:
// these config variable names has been choosed to maintain compatibility
// with code taken from Mantis.
// 
// SMTP server Configuration ("localhost" is enough in the most cases)
$g_smtp_host        = 'smtp.corp.com';  # SMTP 服務必須配置,可配置你公司發送郵件服務器地址

# Configure using custom_config.inc.php
$g_tl_admin_email     = 'test@corp.com'; #問題錯誤通知,配置你公司的郵箱
$g_from_email         = 'test@corp.com';  # 收到郵件看到的發送地址

$g_return_path_email  = 'test@corp.com';#如果收到郵件的人進行回復的郵件地址

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

# Taken from mantis for phpmailer config
define ("SMTP_SEND",2);
$g_phpMailer_method = SMTP_SEND;#使用SMTP協議進行發送

// Configure only if SMTP server requires authentication
$g_smtp_username    = 'test@corp.com';  # smtp發送的用戶名  
$g_smtp_password    = 'test';  # 發送用戶的密碼

// ----------------------------------------------------------------------------

 

備注:紅色字體為修改部分。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM