2013-07-11 36 views
0

過去我已經通過谷歌smtp發送電子郵件,現在我想從我自己的服務器發送電子郵件。從我自己的服務器發送帶codeigniter(配置)的電子郵件

我按照this example來設置我的電子郵件配置文件。這是我的email.php文件的樣子:

$config['useragent']  = 'CodeIgniter';   
$config['protocol']   = 'mail';   
$config['mailpath']   = '/usr/sbin/sendmail'; 
$config['smtp_host']  = 'localhost'; 
$config['smtp_user']  = '[email protected]'; 
$config['smtp_pass']  = 'testtest'; 
$config['smtp_port']  = 25; 
$config['smtp_timeout']  = 5; 
$config['wordwrap']   = TRUE; 
$config['wrapchars']  = 76; 
$config['mailtype']   = 'text'; 
$config['charset']   = 'utf-8'; 
$config['validate']   = FALSE; 
$config['priority']   = 3; 
$config['crlf']    = "\r\n"; 
$config['newline']   = "\r\n"; 
$config['bcc_batch_mode'] = FALSE; 
$config['bcc_batch_size'] = 200; 

我有一個Apache服務器。我有DirectAdmin軟件,我已經使用它設置了一個帶密碼(testtest)的電子郵件帳戶([email protected])。這是我必須在配置文件中設置的stmp_user和smtp_pass。

令人奇怪的是,這是因爲:

$this->email->send() 

返回true,但不發送電子郵件。 print_debugger返回此結果:

Your message has been successfully sent using the following protocol: mail 
User-Agent: CodeIgniter 
Date: Thu, 11 Jul 2013 08:36:13 +0200 
From: "Publishwall.si" 
Return-Path: 
Reply-To: "[email protected]" 
X-Sender: [email protected] 
X-Mailer: CodeIgniter 
X-Priority: 3 (Normal) 
Message-ID: <[email protected]> 
Mime-Version: 1.0 
Content-Type: text/plain; charset=utf-8 
Content-Transfer-Encoding: 8bit 
=?utf-8?Q?Publishwall.si_-_Aktivacija_ra=c4=8duna?= 
test 

但我還沒有收到電子郵件。此外,調試器中的「Reply-To」字段不是我設置用來發送郵件的字段。也許有什麼毛病我的配置在php.ini:

[mail function] 
; For Win32 only. 
; http://php.net/smtp 
SMTP = localhost 
; http://php.net/smtp-port 
smtp_port = 25 

; For Win32 only. 
; http://php.net/sendmail-from 
;sendmail_from = [email protected] 

; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). 
; http://php.net/sendmail-path 
;sendmail_path = 
+0

當您嘗試從本地服務器發送電子郵件時會發生這種情況。 –

回答

1

你可能要檢查你的郵件服務器日誌。這些應該告訴你,郵件服務器是否甚至從腳本接收到排隊消息 - 如果是,當它試圖將消息傳遞給遠程MTA時發生了什麼。

+0

對於1and1,我意識到共享主機的SMTP端口不是25而是465.如果您使用1and1,這可能會對您有所幫助。如果沒有,請確保您具有有關服務器的所有詳細信息。 – iGbanam

0

你要把它寄給哪裏?嘗試發送到您的其他電子郵件。我知道當我使用谷歌應用時,我有一個問題發送到相同的域名。

嘗試發送它到hotmail或雅虎。

相關問題