3

Mail is not working on my AWS server with zend.

I have used:

GitHub link this library for mail

I have set AMAZON_AWS_ACCESS_KEY and AMAZON_AWS_PRIVATE_KEY but its not working

Please give me any idea for this problem

this is my action

public function testmailAction() {
    
        echo 'Access '.AMAZON_AWS_ACCESS_KEY . "<br/>";
        echo 'Private '.AMAZON_AWS_PRIVATE_KEY. "<br/>";
        echo 'From '.AMAZON_SES_FROM_ADDRESS. "<br/>";
        echo 'To '.AMAZON_SES_TO_ADDRESS. "<br/>";
        
        
        //Load the required dependencies
        require_once 'Zend/Mail.php';
        require_once 'App/Mail/Transport/AmazonSES.php';
        
        $mail = new Zend_Mail('utf-8');
        $transport = new App_Mail_Transport_AmazonSES(
            array(
                'accessKey' => AMAZON_AWS_ACCESS_KEY,
                'privateKey' => AMAZON_AWS_PRIVATE_KEY
            )
        );
        
        $mail->setBodyText('Lorem Ipsum Dolo Sit Amet');
        $mail->setBodyHtml('Lorem Ipsum Dolo <b>Sit Amet</b>');
        $mail->setFrom(AMAZON_SES_FROM_ADDRESS, 'John Doe');
        $mail->addTo(AMAZON_SES_TO_ADDRESS);
        $mail->setSubject('Test email from Amazon SES without attachments');
        $mail->send($transport);
    die('success');
    }

I have used AmazonSES.php class for email setting when I am runing this action then its print 'success' but I am not getting any mail in my mail inbox and error in code.

starball
  • 20,030
  • 7
  • 43
  • 238
Kuldeep Raj
  • 791
  • 1
  • 7
  • 29
  • 1
    Need more information, how is it "not working"? – Tomdarkness Oct 14 '13 at 16:29
  • @Tomdarkness added some more information – Kuldeep Raj Oct 15 '13 at 08:50
  • @Tomdarkness check this now – Kuldeep Raj Oct 22 '13 at 05:22
  • Interesting... I had similar issue... anyways, what is `AMAZON_SES_TO_ADDRESS` set to? your email address? – Keval Domadia Oct 22 '13 at 08:40
  • @KarmicDice yes AMAZON_SES_TO_ADDRESS is mine address and From address is confirmed address – Kuldeep Raj Oct 22 '13 at 10:45
  • Do you have production access to amazon SES? If not, the AMAZON_SES_TO_ADDRESS also needs to be a confirmed address. – Tomdarkness Oct 22 '13 at 18:56
  • @Tomdarkness Yes I have, but when I test mail through amazon test mail(verify email address tab) its working fine . But when I used above code then its not working – Kuldeep Raj Oct 23 '13 at 05:05
  • did you uncomment mail configuration in php.ini of amazon server? or did you tried with simple mail function of php? – Harish Singh Oct 28 '13 at 09:28
  • @Harish Yes I tried simple mail function on amazon server that not working http://stackoverflow.com/questions/19559063/simple-php-mail-function-not-working-on-amazon-server-ec2 – Kuldeep Raj Oct 28 '13 at 09:59
  • Best option is to first establish whether it is SES configuration problem or your application problem. You can try this code to check whether it works with simple PHP? [Sending Email Through Amazon SES From Your Application](http://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-smtp-app.html) – M. Atif Riaz Jan 01 '14 at 08:04

1 Answers1

1

If you are using Ubuntu-Linux or similar, have you got postfix or any other mail delivery application installed?

If you have got a mail service installed, try checking the mail log. Please tell me what service you have installed and I might have an idea on where the logs are stored.