Send Mail Using Amazon Cloud Server With PHP SMTP

In this tutorial i will describe how to send mail using amazon server with PHP SMTP.The amazon cloud server does not allow PHP mail() function to send mail, so that your mail does not work on amazon cloud server. The amazon are providing PHP SDK for PHP mail. We will use php SMTP mailer class to send mail using SMTP. You can also send mail using GMAIL SMTP service.

Before use below code, you should be known about your SMTP user and password, to configure SMTP we need SMTP user name and password.

You can also check other tutorial of php mail,

Configuration Parameters to send mail with PHP SMTP

You will need to configure the following variables to send mail using PHP SMTP:

  • $from : The email address from which you want the message to be sent.
  • $to/$address : The recipient’s email address.
  • $subject : The subject of mail
  • $body : The body of mail message.
  • $host : SMTP server name.
  • $username : the SMTP user name
  • $password : the SMTP user password

Sample code and Example to send mail with PHP SMTP

You can change configuration variable as per your need and use it.I hope you enjoyed sending mail with PHP SMPT on amazon cloud server.

You can download source code from below link.