2016-05-13 10 views
2

私はcodeigniter電子メールライブラリとmailgun smtpを使用して電子メールを送信しようとしています。私は次のエラーを持っているCanotはcodeigniterを使用してmailgun smtpでメールを送信します

$config['mailtype'] = 'html'; 
$config['charset'] = 'utf-8'; 

$config['protocol'] = 'smtp'; 
$config['smtp_host'] = 'smtp.mailgun.org'; 
$config['smtp_port'] = 25; 
$config['smtp_user'] = '[email protected]'; 
$config['smtp_pass'] = 'thepasswordconfiguredinmailgun'; 
$config['smtp_timeout'] = '4'; 
$config['crlf'] = '\n'; 
$config['newline'] = '\r\n'; 

$this->email->initialize($config); 
$this->email->clear(TRUE); 
$this->email->from('[email protected]', 'FromName'); 
$this->email->to('[email protected]'); 

$this->email->subject('Subiect de test'); 
$this->email->message('Testez sa vad daca merge si daca pot sa trimit. Daca nu pot de ce nu pot ?'); 

$this->email->send(); 
echo $this->email->print_debugger(); 

ここ

は、PHPのコードです.... SMTP設定はcorectlyに構成されていると私は問題がある可能性がありますか分かりません Mailgun's documentationをチェックすることにより
The following SMTP error was encountered: 110 Connection timed out 
Unable to send data: AUTH LOGIN 
Failed to send AUTH LOGIN command. Error: 
Unable to send data: MAIL FROM: 

from: 

The following SMTP error was encountered: 
Unable to send data: RCPT TO: 

to: 

The following SMTP error was encountered: 
Unable to send data: DATA 

data: 

The following SMTP error was encountered: 
Unable to send data: User-Agent: CodeIgniter Date: Fri, 13 May 2016 10:19:19 +0300 From: "PADigest" Return-Path: To: [email protected] Subject: =?utf-8?Q?Subiect_de_test?= 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: multipart/alternative; boundary="B_ALT_57357ff767d02" This is a multi-part message in MIME format. Your email application may not support this format. --B_ALT_57357ff767d02 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Testez sa vad daca merge si daca pot sa trimit. Daca nu pot de ce nu pot ? --B_ALT_57357ff767d02 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Testez sa vad daca merge si daca pot sa trimit. Daca nu pot de ce nu pot ? --B_ALT_57357ff767d02-- 
Unable to send data: . 

The following SMTP error was encountered: 
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method. 

User-Agent: CodeIgniter 
Date: Fri, 13 May 2016 10:19:19 +0300 
From: "PADigest" <[email protected]> 
Return-Path: <[email protected]> 
To: [email protected] 
Subject: =?utf-8?Q?Subiect_de_test?= 
Reply-To: "[email protected]" <[email protected]> 
X-Sender: [email protected] 
X-Mailer: CodeIgniter 
X-Priority: 3 (Normal) 
Message-ID: <[email protected]> 
Mime-Version: 1.0 


Content-Type: multipart/alternative; boundary="B_ALT_57357ff767d02" 

This is a multi-part message in MIME format. 
Your email application may not support this format. 

--B_ALT_57357ff767d02 
Content-Type: text/plain; charset=utf-8 
Content-Transfer-Encoding: 8bit 

Testez sa vad daca merge si daca pot sa trimit. Daca nu pot de ce nu pot ? 


--B_ALT_57357ff767d02 
Content-Type: text/html; charset=utf-8 
Content-Transfer-Encoding: quoted-printable 

Testez sa vad daca merge si daca pot sa trimit. Daca nu pot de ce nu pot ? 

--B_ALT_57357ff767d02-- 

答えて

0

ほとんどの場合、これは、ポート#25をブロックするインターネットサービスプロバイダ(「ISP」)によって引き起こされます。これは、居住用ISPを使用している場合に発生する傾向があります。

telnet smtp.mailgun.org 25 

ポート25がブロックされていない場合、あなたはこのようなものが表示されるはずです。:あなたはこれを表示されない場合

Trying 174.37.214.195... 
Connected to mxa.mailgun.org. 
Escape character is '^]'. 
220 mxa.mailgun.org (Mailgun) 

を、これを確認するコマンドラインでのtelnetを実行しようとする

あなたはブロックされています。カップルの回避策があります。HTTP APIに

  • を使用して

    1. 送信は、問題は私の共有ホスティングプロバイダたポート#587または#2525
  • +0

    ポートがブロックされているとは思われません。 localhostをsmtpサーバーとして使用しようとすると、メールが送信されます。私は共有ホスティングをしているので、ターミナルでアクセスすることはできませんが、コンソールでコマンドを書くために電子メール@ホスティングプロバイダを送ってきました。 – florin

    +0

    @florinドキュメントに記載されているように2525などの他のポートを試しましたか? – sotoz

    +0

    はい、私はそれらをすべて試しました:(成功しませんでした:( – florin

    0

    を使用してみてください。彼らは外部smtpメールプロバイダへの接続を受け入れることができない継ぎ目。しかし、私はhttp apiを使ってそれらを送るように私はsotoz答えを受け入れます!

    関連する問題