2017-01-18 4 views
1

私はCodeIgniterのを使用して電子メールを送信しようとしている許可CodeIgniterの電子メール550 5.7.1送信者のドメインが、これは私が使用しているコードです 、

$config = Array(
      'protocol' => 'smtp', 
      'smtp_host' => 'ssl://sub5.mail.xxxxxxxx.com', 
      'smtp_port' => 465, 
      'smtp_user' => '[email protected]', 
      'smtp_pass' => 'xxxxxxxx', 
      'mailtype' => 'html', 
      'charset' => 'iso-8859-1', 
      'wordwrap' => FALSE 
     ); 

$this->load->library('email'); 
$this->email->initialize($config); 
$this->email->set_newline("\r\n"); 

$this->email->clear(TRUE); 

$this->email->from($datadatay['hcusemail'], 'FMF Refund Form Data'); 
$this->email->to("[email protected]"); 
$this->email->cc("[email protected]"); 
$this->email->subject("Refund Form"); 
$this->email->message("The form is attached hereby"); 
$this->email->set_mailtype("html"); 

$this->email->attach($_SERVER['DOCUMENT_ROOT']. '/dist/pdf/' . $filename); 


$this->email->send(); 

このコードは、ローカルホストに完全に正常に動作しません。サーバに公開したときにエラーが発生する

220 homiemail-a119.g.dreamhost.com ESMTP 
<br /><pre>hello: 250-homiemail-a119.g.dreamhost.com 
250-PIPELINING 
250-SIZE 40960000 
250-ETRN 
250-AUTH PLAIN LOGIN 
250-AUTH=PLAIN LOGIN 
250-ENHANCEDSTATUSCODES 
250 8BITMIME 
</pre><pre>from: 250 2.1.0 Ok 
</pre><pre>to: 250 2.1.5 Ok 
</pre><pre>to: 250 2.1.5 Ok 
</pre><pre>data: 354 End data with <CR><LF>.<CR><LF> 
</pre>550 5.7.1 Sender domain not allowed. Please read: http://dhurl.org/20b D157 
<br />The following SMTP error was encountered: 550 5.7.1 Sender domain not allowed. Please read: http://dhurl.org/20b D157 
<br />Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.<br /><pre>User-Agent: CodeIgniter 
Date: Wed, 18 Jan 2017 16:50:59 +0530 
From: &quot;FMF Refund Form Data&quot; &lt;[email protected]&gt; 
Return-Path: &lt;[email protected]&gt; 
To: [email protected] 
Cc: [email protected] 
Subject: =?iso-8859-1?Q?Refund_Form?= 
Reply-To: &quot;[email protected]&quot; &lt;[email protected]&gt; 
X-Sender: [email protected] 
X-Mailer: CodeIgniter 
X-Priority: 3 (Normal) 
Message-ID: &lt;[email protected]&gt; 
Mime-Version: 1.0 


Content-Type: multipart/mixed; boundary=&quot;B_ATC_587f4f9b1eb0f&quot; 

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

--B_ATC_587f4f9b1eb0f 
Content-Type: multipart/alternative; boundary=&quot;B_ALT_587f4f9b1ead4&quot; 

--B_ALT_587f4f9b1ead4 
Content-Type: text/plain; charset=iso-8859-1 
Content-Transfer-Encoding: 8bit 

The form is attached hereby 


--B_ALT_587f4f9b1ead4 
Content-Type: text/html; charset=iso-8859-1 
Content-Transfer-Encoding: quoted-printable 

The form is attached hereby 

--B_ALT_587f4f9b1ead4-- 

--B_ATC_587f4f9b1eb0f 
Content-type: application/x-unknown-content-type; name=&quot;eranga.docx&quot; 
Content-Disposition: attachment; 
Content-Transfer-Encoding: base64 

--B_ATC_587f4f9b1eb0f--</pre> 

多くのことを試してみましたが、何も効果がありません。助けてください。

+1

上記のエラーメッセージで[link](http://dhurl.org/20b)にアクセスし、問題を整理してください。 –

+0

@ Deep3015非常にありがとうございます。しかし、そのURLは何もありません。これはDreamHostのURL短縮名です._ –

+2

上記のリンクは[link](https://help.dreamhost.com/hc/en-us/articles/215036118)にあります。チェックしてください –

答えて

1

このエラーは、あなたのドメインではないドメインからの手紙を送信しようとしていることを意味します。

ログからわかるように、[email protected]からメールを送信します。 しかし、あなたはssl://sub5.mail.xxxxxxxx.comサーバー経由で送信しますが、それは明らかにgmail.comではありません。あなたは送信者のアドレスを偽装します。 Dreamhostはそれを防ぐので、エラーです。

+0

うん..それはまさに問題だった。それを修正しました。今それは正常に動作しています。ありがとう@vaviloff。 –

関連する問題