10

I am using Amazon EC2 Instance for one of my project, I have installed LAMP on linux server and now while I am trying to send email using simple function it is not sending email also is not giving any error for that.

Things I have done so far.

  • Created SES account.
  • Used simple mail function.
  • Enabled port 25 in security groups.
sourabh kasliwal
  • 947
  • 3
  • 8
  • 21
  • Installing sendmail as http://stackoverflow.com/a/24790187/248616 answered below is much better than using SES I think – Nam G VU Sep 18 '14 at 16:12

5 Answers5

33

I solved this issue just by installing sendmail in my instance. Just run bellow command in your terminal

sudo apt-get install sendmail

That worked for me

Nanhe Kumar
  • 15,498
  • 5
  • 79
  • 71
PabloQ
  • 361
  • 3
  • 6
11

If you are using a amazon ec2 ami/linux distro use "sudo yum install sendmail" while in SSH

William Worley
  • 815
  • 1
  • 8
  • 13
10

Although your problem relates to Sendmail have you tried following Amazons Documentation?

http://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-smtp-app.html

This uses postfix but it seems like a better alternative and there's help readily available for it.

You also can use SMTP as Amazon SES supports this:

http://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-smtp.html

I know this doesn't directly answer your question. You might just need to configure the mail settings in php.ini.

mauris
  • 42,982
  • 15
  • 99
  • 131
SamV
  • 7,548
  • 4
  • 39
  • 50
1

If you are using AWS SES you need to make sure you validate the account first:

http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses.html

With the exception of addresses containing labels (see below), you must verify each email address that will be used as a "From" or "Return-Path" address for your messages. The entire email address is case-sensitive. For example, if you verify sender@example.com, you cannot send emails from sender@EXAMPLE.com unless you verify sender@EXAMPLE.com also. (Domain verification, however, is case-insensitive. For more information, see Verifying Domains in Amazon SES.)

Until you are granted production access to Amazon SES, you must also verify the email address of every recipient except for the recipients provided by the Amazon SES mailbox simulator. For more information about the mailbox simulator, see Testing Amazon SES Email Sending. For more information about production access, see Requesting Production Access to Amazon SES.

E.J. Brennan
  • 45,870
  • 7
  • 88
  • 116
-2

Alternatively, instructions mentioned in the following link can be followed. In this method installing postfix, sendmail or any other mail server is not required.

It uses the PHPMailer class to send email through Amazon SES using the SMTP interface.

https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-using-smtp-php.html

It took me a whole day to reach this simpler solution.