Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Update mail.php #2

Merged
merged 3 commits into from Mar 14, 2017
Merged

Update mail.php #2

merged 3 commits into from Mar 14, 2017

Conversation

ihsanberahim
Copy link
Contributor

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

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
@vinkla
Copy link
Contributor

vinkla commented Mar 12, 2017

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?

@ihsanberahim
Copy link
Contributor Author

ihsanberahim commented Mar 12, 2017

this plugin required to enable SMTP in Wordpress.

Mailcatcher don't have and no need Auth. We can leave username and password as null.
The update i made suite more than 1 situation automatically. If developer set the username and password, for sure they needs SMTPAuth otherwise SMTP should know that if there are no credential for sure we SMTPAuth should be disabled.

@vinkla
Copy link
Contributor

vinkla commented Mar 12, 2017

In that case you can use the default setting and not use this plugin. Right?

@ihsanberahim
Copy link
Contributor Author

ihsanberahim commented Mar 12, 2017

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. :)

Copy link
Contributor

@vinkla vinkla left a 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));
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

approving #r105564797
Copy link
Contributor Author

@ihsanberahim ihsanberahim left a 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));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

@vinkla vinkla left a 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();
Copy link
Contributor

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.
Copy link
Contributor Author

@ihsanberahim ihsanberahim left a 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.

@vinkla vinkla merged commit c577a87 into wordplate:master Mar 14, 2017
@vinkla
Copy link
Contributor

vinkla commented Mar 14, 2017

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
2 participants