Created
March 22, 2018 06:15
-
-
Save taleeb35/80e1f43b42f754beca8e8349e284c355 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php include("phpmailer/PHPMailerAutoload.php"); | |
$mail = new PHPMailer; | |
$mail->isSMTP(); | |
$mail->Host = 'smtp.sendgrid.net'; | |
$mail->SMTPAuth = true; | |
$mail->Username = 'takmeel'; // SMTP username | |
$mail->Password = 'shineE065'; // SMTP password | |
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted | |
$mail->Port = 25; // TCP port to connect to | |
$mail->setFrom("[email protected]", 'Shura Emirates'); | |
$mail->addAddress('[email protected]' , 'Taleeb Ahmad'); // Add a recipient | |
$mail->isHTML(true); // Set email format to HTML | |
$mail->Subject = 'Test'; | |
$mail->Body = 'Hello'; | |
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; | |
if(!$mail->send()) { | |
echo 'Message could not be sent.'; | |
echo 'Mailer Error: ' . $mail->ErrorInfo; | |
} else { ?> | |
<h3 style="color:#000;font-size: 14px;margin-bottom: 10px;">Thank you for contacting us. We will get back to you soon.</h3> | |
<?php } ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dude, maybe you don't want to post your password publicly?