Conversation
SMTP Error: Could not authenticate. (fixed) * it works with mailcatcher too by simply set MAIL_HOST=127.0.0.1 and set MAIL_PORT=1025
Thanks for taking the time to make a pull request. Though, I don't understand the use case? If there are no credentials you can simply not use this plugin? |
this plugin required to enable SMTP in Wordpress. Mailcatcher don't have and no need Auth. We can leave username and password as null. |
In that case you can use the default setting and not use this plugin. Right? |
in wordpress no SMTP setting by default. Just the main issue here is this plugin hardcoded SMTPAuth enabled. May be that is the only main issue. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see my review comments.
mail.php
Outdated
$username = env('MAIL_USERNAME'); | ||
$password = env('MAIL_PASSWORD'); | ||
|
||
$mail->SMTPAuth = (!empty($username) && !empty($password)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update this line to the following;
$mail->SMTPAuth = env('MAIL_USERNAME') && env('MAIL_PASSWORD');
Then please test it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
approving #r105564797
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested. it works.
mail.php
Outdated
$username = env('MAIL_USERNAME'); | ||
$password = env('MAIL_PASSWORD'); | ||
|
||
$mail->SMTPAuth = (!empty($username) && !empty($password)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see my new comment.
mail.php
Outdated
|
||
$mail->Host = env('MAIL_HOST'); | ||
$mail->Port = env('MAIL_PORT', 587); | ||
$mail->Username = env('MAIL_USERNAME'); | ||
$mail->Password = env('MAIL_PASSWORD'); | ||
|
||
$mail->IsSMTP(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ihsanberahim why did you move this here?
i tested it. It works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put back IsSMTP where it placed before.
Thanks! |
SMTP Error: Could not authenticate. (fixed)