Welcome Guest, Not a member yet? Register   Sign In
sending email not working
#1

[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...';
}


}
#2

[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
#3

[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
#4

[eluser]InsiteFX[/eluser]
Read this:

CodeIgniter Email Library

Look at Setting Email Preferences.

InsiteFX
#5

[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 )
#6

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

InsiteFX
#7

[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
#8

[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:




Theme © iAndrew 2016 - Forum software by © MyBB