[Sendmail] - Mail() function not working
- 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.iniin 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: email@example.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, [22.214.171.124]<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 firstname.lastname@example.org 18/12/18 01:32:53 >> MAIL FROM: <email@example.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>
18/12/18 01:32:53 : Must issue a STARTTLS command first. a73sm21547549pfa.7 - gsmtp<EOL>
@shivapoudel : The
laragon.inistores 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 WP
wp_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( 'firstname.lastname@example.org', '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.
$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