php - Codeigniter Can not send email there are some error when hosting -
my project work fine in localhost of pc, hosted on server there errors.
this function in codeigniter:
function sendmail_confirm_register(){ $config = array( 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.googlemail.com', 'smtp_port' => 465, 'smtp_user' => 'myemail@gmail.com', 'smtp_pass' => 'mypassword', 'mailtype' => 'html', 'charset' => 'iso-8859-1', 'wordwrap' => true ); $this->load->library('email', $config); $this->email->set_newline("\r\n"); $this->email->from('myemail@gmail.com','mydomain.com'); $this->email->to('someone@gmail.com'); $this->email->subject('complete registration!'); $this->email->message('test message'); if($this->email->send()) { echo "the email has been sent!"; } else { echo "cannot send email!"; } }
this error below:
a php error encountered
severity: warning
message: fsockopen(): php_network_getaddresses: gethostbyname failed. errno=0
filename: libraries/email.php
line number: 1689 php error encountered
severity: warning
message: fsockopen(): unable connect ssl://smtp.googlemail.com:465 (php_network_getaddresses: gethostbyname failed. errno=0)
filename: libraries/email.php
line number: 1689 php error encountered
severity: warning
message: fwrite() expects parameter 1 resource, boolean given
filename: libraries/email.php
line number: 1846 php error encountered
severity: warning
message: fgets() expects parameter 1 resource, boolean given
filename: libraries/email.php
line number: 1869 php error encountered
severity: warning
message: fwrite() expects parameter 1 resource, boolean given
filename: libraries/email.php
line number: 1846 php error encountered
severity: warning
message: fgets() expects parameter 1 resource, boolean given
filename: libraries/email.php
line number: 1869 php error encountered
severity: warning
message: fwrite() expects parameter 1 resource, boolean given
filename: libraries/email.php
line number: 1846 php error encountered
severity: warning
message: fgets() expects parameter 1 resource, boolean given
filename: libraries/email.php
line number: 1869 php error encountered
severity: warning
message: fwrite() expects parameter 1 resource, boolean given
filename: libraries/email.php
line number: 1846 php error encountered
severity: warning
message: fgets() expects parameter 1 resource, boolean given
filename: libraries/email.php
line number: 1869 php error encountered
severity: warning
message: fwrite() expects parameter 1 resource, boolean given
filename: libraries/email.php
line number: 1846 php error encountered
severity: warning
message: fwrite() expects parameter 1 resource, boolean given
filename: libraries/email.php
line number: 1846 php error encountered
severity: warning
message: fgets() expects parameter 1 resource, boolean given
filename: libraries/email.php
line number: 1869 php error encountered
severity: warning
message: cannot modify header information - headers sent (output started @ /base/data/home/apps/s~postleng/2.380394098175674288/ctm-hotel-system/core/exceptions.php:185)
filename: core/common.php
line number: 442 error encountered
the following smtp error encountered: 0 php_network_getaddresses: gethostbyname failed. errno=0 unable send data: auth login failed send auth login command. error: unable send data: mail from:
from:
the following smtp error encountered: unable send data: rcpt to:
to:
the following smtp error encountered: unable send data: data
data:
the following smtp error encountered: unable send data: user-agent: codeigniter date: thu, 27 nov 2014 03:57:16 -0500 from: "mydomain.com" return-path: to: login@gmail.com subject: =?iso-8859-1?q?complete_your_registration!?= reply-to: "myemail@gmail.com" x-sender: myemail@gmail.com x-mailer: codeigniter x-priority: 3 (normal) message-id: <5476e76cb1a8a@gmail.com> mime-version: 1.0 content-type: multipart/alternative; boundary="b_alt_5476e76cb1ae4" multi-part message in mime format. email application may not support format. --b_alt_5476e76cb1ae4 content-type: text/plain; charset=iso-8859-1 content-transfer-encoding: 8bit
please thank in advance.
may try using sendmail protocol?
Comments
Post a Comment