CodeIgniter Forums
sending email not working - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: sending email not working (/thread-35900.html)



sending email not working - El Forum - 11-15-2010

[eluser]sudinem[/eluser]
I've use these codes to send email. But, when I run the code, it returns me the message "Something went wrong..."
But, when I change $config['protocol']='mail'. ...Then I get the message "your message has been sent". But, when I check my inbox, I didn't get any mails.

I've googled my problem but couldn't get any solution. Do you guyz have any solution???


Code:
function testMailer()
{
$config['protocol']='sendmail';
$this->load->library('email');
$this->email->initialize($config);

$name = "test";
$email = "[email protected]";
$message= "Testing";

$this->email->from("[email protected]", "name");
$this->email->to('[email protected]');

$this->email->subject('Subject');
$this->email->message($message);
if($this->email->send())
{
echo $this->email->print_debugger();
}
else
{
echo 'Something went wrong...';
}


}



sending email not working - El Forum - 11-15-2010

[eluser]InsiteFX[/eluser]
You need to load the library before you set any email parameters!
Code:
$this->load->library('email');
$config['protocol']='sendmail';

$this->email->initialize($config);

InsiteFX


sending email not working - El Forum - 11-15-2010

[eluser]sudinem[/eluser]
[quote author="InsiteFX" date="1289846558"]You need to load the library before you set any email parameters!
Code:
$this->load->library('email');
$config['protocol']='sendmail';

$this->email->initialize($config);

InsiteFX[/quote]
No effect even after doing this Sad


sending email not working - El Forum - 11-15-2010

[eluser]InsiteFX[/eluser]
Read this:

CodeIgniter Email Library

Look at Setting Email Preferences.

InsiteFX


sending email not working - El Forum - 07-14-2011

[eluser]ardi[/eluser]
I have same problem like summer student, when i tried to send email, debugger said email has been successfully and without error, but when i checked in my inbox, it's nothing ...
for information i use codeigniter 2.0,
any someone can fix it ???

thanks for your help before
(i'm sorry for my bad english Smile )


sending email not working - El Forum - 07-14-2011

[eluser]InsiteFX[/eluser]
Check your php.ini settings

InsiteFX


sending email not working - El Forum - 07-14-2011

[eluser]cideveloper[/eluser]
If you have a gmail account try these settings

Code:
$config['protocol']="smtp";
$config['smtp_host']="ssl://smtp.googlemail.com";
$config['smtp_port']="465";
$config['smtp_timeout']="30";
$config['smtp_user']="[email protected]";
$config['smtp_pass']="password";
$config['charset']="utf-8";
$config['newline']="\r\n";

That way you can check with a server you know that can send mail. Sometimes sendmail might not be configured properly, and this will rule out any problem with CI


sending email not working - El Forum - 07-15-2011

[eluser]ardi[/eluser]
awesome, my problem solved quickly ... thanks a ton for all responses, and special thanks for cideveloper Smile

terima kasih banyak (say thanks in indonesian) :coolsmile: