Cannot send mail for Lightsail Wordpress

Keywords: WordPress - AWS - Technical issue - Other

bndiagnostic ID: 3386d084-2764-283b-1814-b30cd8a11e5c

bndiagnostic output:

? Apache: Found possible issues
? Mariadb: Found possible issues
? Resources: Found possible issues
https://docs.bitnami.com/general/apps/wordpress/troubleshooting/debug-errors-apache/
https://docs.bitnami.com/aws/apps/wordpress/troubleshooting/debug-errors-mariadb/

bndiagnostic failure reason: The suggested guides are not related with my issue

Description:
I still cannot see the email going through after following the steps below:

  1. Ask AWS to unblock the email restriction on the Lightsail server
  2. sudo apt-get install sendmail to install sendmail. After this step, I can now see sendmail in /usr/sbin
  3. sudo sendmailconfig and accept all default
  4. Update /opt/bitnami/php/etc/php.ini by enabling the line sendmail_path: env -i /usr/sbin/sendmail -t -i
  5. nano /etc/hosts to make sure my host name is there 127.0.0.1 localhost myhostname
  6. Restart server sudo /opt/bitnami/ctlscript.sh restart
  7. Restart php-fpm service sudo /opt/bitnami/ctlscript.sh restart php-fpm

AWS block port 25 by default.

Solution 1: Remove port 25 restriction from your Lightsail instance

Solution 2: Use SMTP plugin WP Mail SMTP by WPForms – WordPress plugin | WordPress.org

Have a good day in technical life. :smiley:

Hello,
We are also facing the same problems. We have submitted the form twice but still can’t send mails. How can we reach out to the AWS through ticket or get a reply?
We have configured MX records and SPF records for our domain to send mails but still not luck.
Any ideas?

I revolve this issue and here is the solution I posted in Stackoverflow.
https://stackoverflow.com/questions/72015253/aws-lightsail-wordpress-template-failed-to-send-email/72015254#72015254

@cupidchan Thank you for your reply. We will try this.
Do you think the /sendmail installation will run seamlessly with 1GB RAM on instance? It’s slowing our server down.
Also, how can we know if Port 25 is opened already? We have already submitted request yesterday to open it.
Regards

Based on my experience, after you open a ticket to AWS, they will forward you a form you need to fill and justify why you want the port to open. Once it’s approved, they will do the background work to make it happens. You can ask them to confirm and pinging through the port to see if traffic comes through.

Can you please let me know where to open a ticket and what information we have to provide? We haven’t got any forms, we submitted the form present above in the second reply.
Also, we are having some issues with high memory usage through error_logs. We found that one plugin has issues but not sure what are the other two consuming the resources.

We were able to install the sendmail but we can’t edit this file /etc/mail/sendmail.mc it says it’s a readonly file. Any advice will be much helpful.
Thank you again!

Did you use sudo? That should overwrite the read-only default and allow you to edit.

Did you try this :point_up_2:

AWS not happy to open port 25 for you even you pay for their service!

@suloveoun We have done it! It’s just as @cupidchan mentioned on his Stack Thread. This should be the right solution for it.
Cheers!