Skip to content

Unable to send email from WHM/cPanel instance running on Lightsail

0

I've tried to send an email from my WHM instance via a 3rd party SMTP server and get a "unable to connect to ssl://my-hostname" error.

When I set up a local email account from within my cPanel and try to send an email via localhost, I find that the recipient's email address gets removed from the email headers and so the email fails!?

In both cases, the emails are generated and sent from a PHP script running on my instance.

Preferably, I'd like to send emails via a local email account on the server.

Anyone know what's causing these issues?

asked a year ago375 views
1 Answer
0

Have you tried following the guide for cPanel & WHM on Lightsail found here? https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-quick-start-guide-cpanel.html

Relevant guid for email port 25: https://repost.aws/knowledge-center/lightsail-port-25-throttle

AWS
MODERATOR
answered a year ago
  • I saw that but when I run the script directly from the command line, the email sends OK. When I run that script via a cron job, it all goes wrong! Also, in my website' config file, I specify port 587 rather than port 25.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.