Home
> Uncategorized > Send email via #Amazon SES via PHP using #PHPMailer
Send email via #Amazon SES via PHP using #PHPMailer
<?php
require_once(‘scripts/phpmailer/PHPMailerAutoload.php’);
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug = 0;
$mail->SMTPAuth = true;
$mail->SMTPSecure = “tls”;
$mail->Host = “email-smtp.eu-west-1.amazonaws.com”;
$mail->Port = 587;
$mail->Username = “xxxx”;
$mail->Password = “xxxx”;
$mail->CharSet = ‘windows-1250’;
$mail->SetFrom (‘info@domain.com’, ‘info@domain.com’);
$mail->Subject = “Subject line “;
$mail->ContentType = ‘text/plain’;
$mail->IsHTML(false);
$mail->Body = “this is the body”;
$mail->AddAddress (‘someone@gmail.com’, ‘Someone’);
if(!$mail->Send())
{
$error_message = “Mailer Error: ” . $mail->ErrorInfo;
} else
{
$error_message = “Successfully sent!”;
}
echo $error_message;
?>
Categories: Uncategorized
Comments (0)
Trackbacks (0)
Leave a comment
Trackback