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-адрес ничто. он показывает только _This является ShortHost URL shortener._ –

+2

Выше ссылка идет на [link] (https://help.dreamhost.com/hc/en-us/articles/215036118) .check it –

ответ

1

Эта ошибка означает, что вы пытаетесь отправить письмо из домена, который не принадлежит вам.

Как видно из журнала, вы отправляете письмо от [email protected]. Но вы отправляете его через ssl://sub5.mail.xxxxxxxx.com сервер, который, очевидно, не gmail.com. Вы обманываете адрес отправителя. Dreamhost предотвращает это, следовательно, ошибка.

+0

Да. Это была именно эта проблема. Исправлено. теперь он работает нормально. Большое спасибо @vaviloff. –

Смежные вопросы