I’m trying to setup SMTP gateway for my organisation so that my Django web application can send emails to users.
I have been following this documentation.
However, I am having difficulty understanding what to input in the ‘Gateway Address’ field. I’ve tried using the URL smtp.mail.us-west-2.awsapps.com
as the gateway address, where us-west-2
is my region.
Unfortunately, I get an error message that says:
Failed to connect with gateway address
Is there an alternative method for setting up an SMTP server so that I can send emails to users from my web application?
2
Answers
You’re using the wrong service.
Amazon WorkMail is for managing, sending and receiving business emails, calendars, and contacts. Think of it similar to Microsoft Exchange, GSuite, Office 365 etc. The SMTP gateway option is for setting up a SMTP gateway for Amazon WorkMail to use to send email. It’s not for exposing an SMTP server for your application to use to send emails from.
To send emails to your users programatically through your web app, you need to look at using SES and its SMTP interface.
While WorkMail uses SES to send all email, it doesn’t expose its underlying SMTP connection.
Amazon WorkMail does not provide direct access to SMTP credentials for its mailboxes.
If you want to send emails programmatically or from an application using Amazon WorkMail, you can use the SMTP settings provided by Amazon SES, not Amazon WorkMail directly. Here’s how you can obtain SMTP credentials for Amazon SES:
Log in to your AWS Management Console using the AWS account associated with your Amazon WorkMail.
Once logged in, go to the Amazon SES dashboard by either searching for "SES" in the AWS services search bar or by selecting it from the "All services" list.
Before you can use Amazon SES for sending emails, you need to verify the email address or domain you want to send emails from. This is done to prevent misuse of the service. You can do this under the "Identity Management" section in the SES dashboard.
To get SMTP credentials, go to the "Email Sending" section in the SES dashboard. Here, you can create SMTP credentials by clicking the "Create My SMTP Credentials" button. Follow the on-screen instructions to complete the process.
After you’ve created SMTP credentials, you will be provided with an SMTP username and an SMTP password. These are the credentials you will use to authenticate when sending emails through the Amazon SES SMTP server.
Please note that Amazon WorkMail and Amazon SES are separate services, and while you can use Amazon SES to send emails programmatically, Amazon WorkMail is primarily used for managing email and calendars for your organization.