AWS Messaging & Targeting Blog
Using Microsoft SQL Server 2008 R2 with Amazon SES
This post will help you configure Microsoft SQL Server 2008 R2 to send email through Amazon SES. The instructions apply if you are running SQL Server in Amazon EC2 or hosted elsewhere. This post assumes you are running on Microsoft Windows Server 2008 R2 and SQL Server Management Studio is installed. If you need installation instructions, please refer to the Microsoft SQL Server documentation. The instructions may vary slightly if SQL Server Database Mail profiles or accounts are already set up.
Using Microsoft SQL Server Management Studio
Open Microsoft SQL Server Management Studio and expand the Management node. Right-click Database Mail and select Configure Database Mail in the context menu.
This will launch the Database Mail Configuration Wizard. On the Select Configuration Task wizard page, select Set up Database Mail by performing the following tasks and click Next.
If prompted, enable the Database Mail feature.
On the New Profile wizard page, set Profile name to Amazon SES SMTP.
Now, add a new SMTP account to this profile by clicking the Add… button on the same screen.
- Set Account Name to Amazon SES.
- Set Outgoing SMTP Email to a verified email address associated with your Amazon SES account.
- Set Outgoing SMTP Reply Email to a verified email address associated with your Amazon SES account. This can be the same as the Outgoing SMTP Email.
- Set Server Name to email-smtp.us-east-1.amazonaws.com.
- Set Server Port to 587.
- Set This server requires a secure connection SSL to checked.
- Select Basic Authentication and enter your Amazon SES SMTP username and password. The SMTP credentials are different from your AWS keys.
- Click OK to add this account and associate it with the Amazon SES SMTP profile.
Click Next to get to the Manage Profile Security wizard page,
- Select the Public check box to make Amazon SES SMTP a public profile.
- Select Yes for the Default Profile.
Click Next to get to the System Parameters page. Set Logging Level to Verbose and click Next.
Verify the actions that the wizard will take and click Finish to apply your changes. After the wizard is done and reports success, click Close.
To test your configuration, right click Management » Database Mail » Send Test E-Mail… Enter a recipient address and click Send Test E-Mail.
To verify the email was sent, right click Management » Database Mail » View Database Mail Log. Look for a log entry with Mail successfully sent as the message. This indicates that the email from SQL Server was accepted by Amazon SES for delivery.
Final Thoughts
We hope that you now have the configuration to use SQL Server 2008 R2 with Amazon SES. If you have comments or feedback about this service, please post them in the Amazon SES forums. We actively monitor the forum and frequently engage with customers. Happy sending with Amazon SES!