benedmunds / CodeIgniter-Ion-Auth

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

Forgot password not sending mail #1520

Closed juliencolombeau closed 3 years ago

juliencolombeau commented 3 years ago

The website i use is sending mails correctly for contact, subscription, creating user ... but the ion_auth forgot_password is not sending email. It's just terminate successfully with "Your Email has successfully been sent." No error at $this->email->print_debugger()

I try this code in different controllers & views

$this->email->from($from);
        $this->email->to($to);
        $this->email->subject($subject);
        $this->email->message($message);

        if ($this->email->send()) {
            echo 'Your Email has successfully been sent.';
        } else {
            show_error($this->email->print_debugger());
        }

It's always sending mails.

Thanks

benedmunds commented 3 years ago

I doubt it's anything in Ion Auth if $this->email->sent() is returning true.

You could try printing debug info regardless to see if there's anything helpful there. Also make sure to check spam or your email server logs directly.

datamweb commented 3 years ago

Hi, @benedmunds I tested specifically on online hosting with the following settings:

public $useCiEmail  = true; // Send Email using the builtin CI email class...
public $emailConfig = [
            'protocol'  => 'SMTP',
            'smtp_host' => 'mail.myDomain.ir',
            'smtp_port' => 465,
            'smtp_user' => 'user@myDomain.ir',
            'smtp_pass' => 'MyEmailPasss',
            'mailType'  => 'html',
            'charset'   => 'UTF-8'
];

Works well.

@juliencolombeau , note that Forge Password does not work for users who are not active (in Table> users :: active = 0) . So check if the user who intends to use Forget Password is active (active = 1)?? And Some hosts send emails to a limited number of emails per day or hour. The following email has been canceled for me due to the high number of submissions.

EmailSender

benedmunds commented 3 years ago

Closing due to inactivity. Feel free to re-open if this is still an issue.