Amazon has instructions for postfix and sendmail, but not msmtp (simple SMTP client), so adding them here.
Log into the AWS Management Console. In the SES tab, select SMTP Settings and click on Create a New SMTP User. Use the default User Name or edit this name and click Create. Copy your credentials or click on Download Credentials.
Install msmtp (ubuntu)
sudo apt-get install msmtp msmtp-mta
Configure it (sudo nano /etc/msmtprc
):
defaults
tls on
tls_starttls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
syslog on
account default
host email-smtp.us-east-1.amazonaws.com
port 587
auth on
user YOUR_AMAZON_SES_SMTP_USERNAME
password YOUR_AMAZON_SES_SMTP_PASSWORD
from YOUR_AMAZON_SES_VERIFIED_SENDER
Use it. You don't need to set up PHP with the server info; the default configuration will pass messages to sendmail, and you're good to go.
<?php
mail("[email protected]", "some subject", "some message");
?>
If you don't use PHP, you can test on the command line:
$ sendmail [email protected]
Subject: test subject
This is a test message!
^D
(The ^D
means type control-D to stop typing the message and send it.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With