[Sendmail] - Mail() function not working
-
My notes:
- I don't wanna use MailHug as Gmail is perfect for me
- Apache's SSL port are enabled.
- Mailcatcher is displaying notification correctly but email is not received in gmail.
- Laragon Mail Analyzer is working as expected and received email.
- Since my Google account is 2FA, so using App Password.
- Will distributing
laragon.ini
in public leaks App password, asking because can it be decrypted or not.
Content from debug.log
18/12/18 01:32:52 ** --- MESSAGE BEGIN --- 18/12/18 01:32:52 ** To: dev.shivapoudel@gmail.com 18/12/18 01:32:52 ** Subject: Test 18/12/18 01:32:52 ** 18/12/18 01:32:52 ** Hello! 18/12/18 01:32:52 ** --- MESSAGE END --- 18/12/18 01:32:52 ** Failed to load SSL libraries: Could not load SSL library. 18/12/18 01:32:52 ** Connecting to smtp.gmail.com:587 18/12/18 01:32:52 ** Connected. 18/12/18 01:32:53 << 220 smtp.gmail.com ESMTP a73sm21547549pfa.7 - gsmtp<EOL> 18/12/18 01:32:53 >> EHLO laragon.org<EOL> 18/12/18 01:32:53 << 250-smtp.gmail.com at your service, [103.232.231.206]<EOL>250-SIZE 35882577<EOL>250-8BITMIME<EOL>250-STARTTLS<EOL>250-ENHANCEDSTATUSCODES<EOL>250-PIPELINING<EOL>250-CHUNKING<EOL>250 SMTPUTF8<EOL> 18/12/18 01:32:53 ** Authenticating as dev.shivapoudel@gmail.com 18/12/18 01:32:53 >> MAIL FROM: <dev.shivapoudel@gmail.com><EOL> 18/12/18 01:32:53 << 530 5.7.0 Must issue a STARTTLS command first. a73sm21547549pfa.7 - gsmtp<EOL> 18/12/18 01:32:53 ** Disconnecting from smtp.gmail.com:587 18/12/18 01:32:53 ** Disconnected. 18/12/18 01:32:53 ** Disconnected. 18/12/18 01:32:53 ** Must issue a STARTTLS command first. a73sm21547549pfa.7 - gsmtp<EOL>
Content from
error.log
18/12/18 01:32:53 : Must issue a STARTTLS command first. a73sm21547549pfa.7 - gsmtp<EOL>
-
@shivapoudel : The
laragon.ini
stores settings. Sensitive information like MySql root's password will be encrypted. However, I don't need it for now.Let me check your case and get back to you soon.
-
@shivapoudel : I can send emails fine from my test gmail account.
-
For me no success. Can you elaborate the steps for 2 Factor authentication gmail working procedure. How do you use
mail()
function. For me in WPwp_mail()
won't work and it uses PHPmainler library.
-
@leokhoa I created a new gmail account without any two factor authentication. Also it didn't work. My site has SSL will that hamper in sending mail. Test email is successful and send Configuration OK message but when using
mail( 'laragon.debugging@gmail.com', 'Hi Shiva', 'I am testing laragon mail feature.' );
No luck to find why this is not working form me and its working for you
-
@shivapoudel : I can send mail OK.
For the$to
, you should change to an account different from your sender email.
-
@leokhoa Now I got it working. Thanks!
-
@shivapoudel : I'm glad it works
Cheers!