benedmunds / CodeIgniter-Ion-Auth

Simple and Lightweight Auth System for CodeIgniter
http://benedmunds.com/ion_auth/
MIT License
2.34k stars 1.14k forks source link

Ion auth not emailing #192

Closed funch closed 12 years ago

funch commented 12 years ago

I can't get ion auth to email me, for instance when trying to get a new password. Nothing happens. Usually i get my emails working with CI by adding a config directly to the email lib call, but that doesn't change anything either.

What can i possible do wrong here??

benedmunds commented 12 years ago

Give me an example of the code you're using. I also recommend using an email config file.

-Ben Edmunds

On Apr 20, 2012, at 4:44 PM, funch reply@reply.github.com wrote:

I can't get ion auth to email me, for instance when trying to get a new password. Nothing happens. Usually i get my emails working with CI by adding a config directly to the email lib call, but that doesn't change anything either.

What can i possible do wrong here??


Reply to this email directly or view it on GitHub: https://github.com/benedmunds/CodeIgniter-Ion-Auth/issues/192

funch commented 12 years ago

Well i tried just to change a bit in the libraries/ion_auth.php so that i called this instead: $config = array(smtp info) $this->ci->load->library('email', $config);

Somehow my CI is not working with email config in the config folder as a config file. Not sure why, but usually my emails are working fine when i do like that. Maybe the problem really is because my email config is not working, and i really don't know why..

benedmunds commented 12 years ago

If you try to email with that config in your own controller (outside of ion auth) does it work? If not, it's something with your environment or setup...

-Ben Edmunds

On Apr 20, 2012, at 5:00 PM, funch reply@reply.github.com wrote:

Well i tried just to change a bit in the libraries/ion_auth.php so that i called this instead: $config = array(smtp info) $this->ci->load->library('email', $config);

Somehow my CI is not working with email config in the config folder as a config file. Not sure why, but usually my emails are working fine when i do like that. Maybe the problem really is because my email config is not working, and i really don't know why..


Reply to this email directly or view it on GitHub: https://github.com/benedmunds/CodeIgniter-Ion-Auth/issues/192#issuecomment-5253031

funch commented 12 years ago

Yes it works perfectly fine outside of ion auth with that config exactly.

benedmunds commented 12 years ago

What if you use a config file? Is the ion auth config set to email for what your testing?

funch commented 12 years ago

I can't use a config file, i have no idea but my CI won't use a config file for emails. Its just not working at all, get a bunch of php errors and have tried different things. If you somehow know a trick to that as well it would be very helpful.

I think the script is sending now, after i tried the config again inside the lib file. It ended up in spam folder, but at least it was sent.

benedmunds commented 12 years ago

Glad it's working.

For the config file error, what version of CI? Post some examples of what you did and the errors you got.

funch commented 12 years ago

I autoload: email config, email library I have this inside email config:

$config['protocol'] = 'smtp'; $config['smtp_host'] = 'smtp.url.com'; $config['smtp_user'] = 'postmaster@url.com'; $config['smtp_pass'] = 'pass'; $config['mailtype'] = 'html'; $config['charset'] = 'utf-8';

When trying to send emails i get a lot of errors:

fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known fsockopen(): unable to connect to smtp.url.com:25 (php_network_getaddresses: getaddrinfo failed: Name or service not known) fwrite() expects parameter 1 to be resource, boolean given

and so on.. But that is weird for the EXACT same info just loaded with the lib load: $this->load->library('email',$config) works perfectly....

benedmunds commented 12 years ago

That is weird, I don't think you need to auto load the config if you load the library.

-Ben Edmunds

On Apr 20, 2012, at 5:25 PM, funch reply@reply.github.com wrote:

I autoload: email config, email library I have this inside email config:

$config['protocol'] = 'smtp'; $config['smtp_host'] = 'smtp.url.com'; $config['smtp_user'] = 'postmaster@url.com'; $config['smtp_pass'] = 'pass'; $config['mailtype'] = 'html'; $config['charset'] = 'utf-8';

When trying to send emails i get a lot of errors:

fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known fsockopen(): unable to connect to smtp.url.com:25 (php_network_getaddresses: getaddrinfo failed: Name or service not known) fwrite() expects parameter 1 to be resource, boolean given

and so on.. But that is weird for the EXACT same info just loaded with the lib load: $this->load->library('email',$config) works perfectly....


Reply to this email directly or view it on GitHub: https://github.com/benedmunds/CodeIgniter-Ion-Auth/issues/192#issuecomment-5253568

funch commented 12 years ago

This is so weird.. i tried with a different local outgoing server, and now its working.. but funny it worked before with the configuration directly at the lib load... thanks anyway :)

benedmunds commented 12 years ago

Have fun.

-Ben Edmunds

On Apr 20, 2012, at 5:40 PM, funch reply@reply.github.com wrote:

This is so weird.. i tried with a different local outgoing server, and now its working.. but funny it worked before with the configuration directly at the lib load... thanks anyway :)


Reply to this email directly or view it on GitHub: https://github.com/benedmunds/CodeIgniter-Ion-Auth/issues/192#issuecomment-5253849

sigmason commented 11 years ago

hi, benedmunds, i am facing similar issue, i has put following in ion_auth config file $config['use_ci_email'] = TRUE; $config['email_config'] = array( 'mailtype' => 'html', 'protocol' => 'smtp', 'smtp_host' => 'smtp.googlemail.com', 'smtp_port' => 465 , 'smtp_timeout'=>'30', 'smtp_user' => 'xxx@gmail.com', 'smtp_pass' => '**', 'charset' => 'utf-8', 'newline' => '\r\n', 'smtp_crypto' => 'ssl', 'charset' => "iso-8859-1" );

Can you pls tell what is wrong

charlesdg commented 11 years ago

@sigmason +1, did you fix it?

sigmason commented 11 years ago

i tried alot, but its not working out. I am using email functionality of code-ignitor instead of automated mail to be sent by ion auth.

charlesdg commented 11 years ago

@sigmason @benedmunds I did it! I modify when line in the Ion_auth library

go to libraries/Ion_auth.php I changed the line $this->email->clear(); by $this->email->set_newline("\r\n");

and it's working perfectly!

odikonoto commented 10 years ago

Dear All,

Email always as junk instead as at inbox in hotmail. anyone know the cause? Thank you

benedmunds commented 10 years ago

That just depends on your email server and how hosts classify it. Using gmail SMTP will help. If you need more than that I recommend SendGrid.

-Ben Edmunds

On Sep 23, 2013, at 10:02 PM, odikonoto notifications@github.com wrote:

Dear All,

Email always as junk instead as at inbox in hotmail. anyone know the cause? Thank you

— Reply to this email directly or view it on GitHubhttps://github.com/benedmunds/CodeIgniter-Ion-Auth/issues/192#issuecomment-24974900 .

odikonoto commented 10 years ago

@benedmunds, I use smtp gmail:

$config['use_ci_email'] = TRUE; $config['email_config'] = array( 'mailtype' => 'html', 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.gmail.com', 'smtp_user' => 'mymail@gmail.com', 'smtp_pass' => '**', 'smtp_port' => 465 );

in gmail and yahoo in as inbox, but just in hotmail as junk. there is no other way but to use the SendGrid?

benedmunds commented 10 years ago

I would read up on hotmails junk policies and try to meet those. Things like using real emails, not using reply to, having unsubscribe links, etc help with not being spam filtered.

-Ben Edmunds

On Sep 23, 2013, at 10:21 PM, odikonoto notifications@github.com wrote:

@benedmunds https://github.com/benedmunds, I use smtp gmail:

$config['use_ci_email'] = TRUE; $config['email_config'] = array( 'mailtype' => 'html', 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.gmail.com', 'smtp_user' => 'mymail@gmail.com', 'smtp_pass' => '**', 'smtp_port' => 465 );

in gmail and yahoo in as inbox, but just in hotmail as junk. there is no other way but to use the SendGrid?

— Reply to this email directly or view it on GitHubhttps://github.com/benedmunds/CodeIgniter-Ion-Auth/issues/192#issuecomment-24975496 .

odikonoto commented 10 years ago

@benedmunds, please tell me if you know the cause. I already use a different smtp (gmail and yahoo) but the result remains the same. Thank you :)

benedmunds commented 10 years ago

I don't know the cause. You will need to do some research on hotmails spam filtering.

-Ben Edmunds

On Sep 23, 2013, at 10:28 PM, odikonoto notifications@github.com wrote:

@benedmunds https://github.com/benedmunds, please tell me if you know the cause. I already use a different smtp (gmail and yahoo) but the result remains the same. Thank you :)

— Reply to this email directly or view it on GitHubhttps://github.com/benedmunds/CodeIgniter-Ion-Auth/issues/192#issuecomment-24975732 .

odikonoto commented 10 years ago

succeed! cause there is the template used in the email message content. Thanks

benedmunds commented 10 years ago

No problem. Glad you figured it out.

-Ben Edmunds

On Sep 24, 2013, at 1:51 AM, odikonoto notifications@github.com wrote:

succeed! cause there is the template used in the email message content. Thanks

— Reply to this email directly or view it on GitHubhttps://github.com/benedmunds/CodeIgniter-Ion-Auth/issues/192#issuecomment-24985516 .

Lenacus commented 9 years ago

Try this : change in /librairies/Ion_auth.php

line 93 $this->email->initialize($email_config); by $this->load->library('email', $email_config);

Work for me :+1:

sharonrajarajeswari commented 9 years ago

Password Reset Email Sent I got this message. But i cant get the email in the inbox??? what to do? I need a quick answer????

benedmunds commented 9 years ago

You should create a test controller to send emails so you have debug your email config

sharonrajarajeswari commented 9 years ago

ben sry i cant understand . give some code example

benedmunds commented 9 years ago

Make your own controller with test email code

ilmimris commented 8 years ago

Hi @benedmunds,
can I see your test email code? Thank You!