Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in AWS by (19.1k points)

I finally got SES to work, but now I'm confronted with another problem

The email sent leaves amazonses.com in the form and mailed-by fields like this

I am currently on sandbox access

from:    [email protected] via amazonses.com 

to:  [email protected]

date:    Sat, Jun 2, 2012, at 3:30 PM

subject:     Subject message

mailed-by:   amazonses.com

question: how can I remove amazonses.com from these 2 fields and replace the 'mailed-by' field with my companies email address? 

here's my php

function sendMail($to, $subject, $message, $from ) {

    require_once('sdk-1.5.6.2/sdk.class.php');

    $AWS_KEY = "********************";

    $AWS_SECRET_KEY = "****************************************";

    $amazonSes = new AmazonSES(array( "key" => $AWS_KEY, "secret" => $AWS_SECRET_KEY ));

    $response = $amazonSes->send_email(

        $from,

        array('ToAddresses' => array($to)),

        array(

            'Subject.Data' => $subject,

            'Body.Html.Data' => $message,

        )

    );

    if (!$response->isOK()) {

        return false;

    }else {

        return true;

    }

    return false;

}

sendMail('[email protected]', "Body message", "Subject message", "[email protected]" );

1 Answer

0 votes
by (44.3k points)

If you use a verified email by Amazon, then you will not get amazonses.com. 

Or, if you are using a random mail, then you will have to use DKIM.

https://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94k users

Browse Categories

...