CodeIgniter Forums
error sending mail in host - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: error sending mail in host (/showthread.php?tid=41945)



error sending mail in host - El Forum - 05-21-2011

[eluser]duy31187[/eluser]
function test(){
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => '[email protected]',
'smtp_pass' => 'password',
'mailtype' => 'html',
'charset' => 'iso-8859-1'
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");




$this->email->from('[email protected]', 'Me');
$this->email->reply_to('[email protected]', 'Me');
$this->email->to('duy31187@yahoo.com');
$this->email->subject('testing my mail function with CodeIgniter');
$this->email->message('<html><body>this is the content</body></html>');

if ( ! $this->email->send()){
echo 'error! <br />';
echo $this->email->print_debugger();
// Generate error
}else{
echo "send mail successfully";
}

}
this code when I run it in localhost,i work well but when i put it in host megabyet it generate error:fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.googlemail.com:465 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?).can anyone help me ? I have tried with port:587 but it's also error


error sending mail in host - El Forum - 05-24-2011

[eluser]duy31187[/eluser]
no one answer my question. I think maybe I'm using free hosting so it not supply smtp mail.maybe.


error sending mail in host - El Forum - 05-24-2011

[eluser]InsiteFX[/eluser]
Maybe because you posted in the wrong forum topic and did not read the fast reply on use code tags to post!

This forum topic is for user supplied code libraries and nothing else!

Please post your question in the correct forum topic.

Also if you did a forum search on email you would have found your answer!

InsiteFX