Simple contact form sending email via Amazon SES with PHP

Asked

Viewed 624 times

2

For a simple contact form I intend to use Amazon SES with PHP. Basically PHP will send an email to myself with the email of the user who contacted me to give an answer.

Researching, I came across the following alternatives:

  1. Using the PHP Mailer class with Amazon SES credentials.
  2. Set up Postfix as Amazon SES Relay to use the PHP mail() function.
  3. Use PHP Mailer together with Postfix as Amazon SES Relay.

Doubts:

  1. What is the purpose of using Postfix as SES Reset if I can only use PHP Mailer informing the server and credentials?
  2. Because some people set up Postfix as SES Reset and still use PHP Mailer, even though PHP Mailer is able to use SES directly?
  3. Best practice, using Amazon SES, to send contact emails and simple transactional emails with PHP?

1 answer

2


The three alternatives work, however you should consider the application resistance need and shipping quantity.

In Alternative 1, your system is connected directly to Aws SMTP and is locked while operating the mailing list, while in the options 2 and 3 the system delegates to the local Email Service the task of communicating the queue of messages to the AWS, which can happen very quickly and release the system to continue other activities.

For a simple system like the contact form, use the option 1 but for transactional messages from an application I recommend a more robust structure as the option 3 that you mentioned.

  • Right. In this case there is a 4th alternative, which would use the PHP API of Amazon SES. Would this override the need to use a local SMTP server for transactional emails without blocking the queue? What is the best way to send transactional emails without using a local SMTP server like Sendmail and Postfix?

  • 1

    In my opinion, the best way is to implement the use of the php swiftmailer package (http://swiftmailer.org/) and its advanced queuing strategy. But since you said it was something simple, the swiftmailer would be a cannon to kill a fly :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.