Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/content/08/7540608/html/host_sites/computerkida/qa-include/qa-db.php on line 66
ComputerKida: How to send email using amazon ses

Just Click, Drag, PROFIT... It's That Simple!

The Easiest Way to Create High-Converting Lead Pages, Sales Pages, Member Portals and Marketing Pages Like the PROs... The ULTIMATE Marketing Page Creation System is Finally Here...

Take your copy here

Most popular tags

26 questions

5 answers

1 comment

3,362 users

How to send email using amazon ses

0 like 0 dislike
608 views asked Dec 1, 2014 in PHP by patel.varun (1,060 points)
    

1 Answer

0 like 0 dislike

Step 1 - Copy required key from amazon

Get Public Key, Secret Key and Region frmo amazon console

 

Step 2 - Define constant or some configuration in your application

DEFINE("AWS_KEY", 'XXXXXXXXXXXXXX);
DEFINE("AWS_SECRET_KEY", 'XXXXXXXXXXXXXXXXXXXXXXXXXXX');
DEFINE("QWS_REGION", 'us-east-2');
 
Step 3 - Download and copy aws library and configure with your project
if you are using composer then use following code in your composer.json 
{
    "require": {
        "aws/aws-sdk-php": "dev-master"
    }
}

Step 3 - Create object of SesClient and pass keys to function

$sesClient = SesClient::factory(array(
   'key'    => AWS_KEY,
   'secret' => AWS_SECRET_KEY,
   'region' => QWS_REGION
));
 
Step 4 - Setup message and message properties
$msg['Source'] =  "from Email";
 
//ToAddresses must be an array
$msg['Destination']['ToAddresses'][] = array of your to email
$msg['Destination']['BccAddresses'][] = array of your BCC email
 
$msg['Message']['Subject']['Data'] = Your subject
$msg['Message']['Subject']['Charset'] = "UTF-8";
 
$msg['Message']['Body']['Text']['Data'] = $body;
$msg['Message']['Body']['Text']['Charset'] = "UTF-8";
 
 
eg. 
$msg = array();
 
$msg['Source'] =  "no-reply@example.com";
 
//ToAddresses must be an array
$msg['Destination']['ToAddresses'][] = array('email1@eample.com', 'email2@example.com');
$msg['Destination']['BccAddresses'][] = array('email1@eample.com', 'email2@example.com');
 
$msg['Message']['Subject']['Data'] = 'Testing subject';
$msg['Message']['Subject']['Charset'] = "UTF-8";
 
$msg['Message']['Body']['Text']['Data'] = 'Testing body content';
$msg['Message']['Body']['Text']['Charset'] = "UTF-8";
 
Step 5 - Send email
$result = $sesClient->sendEmail($msg);
 
 
answered Dec 16, 2014 by expert (2,200 points)

Related questions

0 like 0 dislike
0 answers 78 views
78 views asked Nov 27, 2014 in API by expert (2,200 points)
0 like 0 dislike
0 answers 72 views
0 like 0 dislike
0 answers 114 views
114 views asked Mar 14, 2015 in PHP by dpatil (1,140 points)
0 like 0 dislike
0 answers 193 views
193 views asked Apr 13, 2015 by dpatil (1,140 points)
0 like 0 dislike
1 answer 353 views
...