X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=framework%2Fmain%2Fthird_party%2Fphp_mailer%2Fexamples%2Ftest_gmail.php;fp=framework%2Fmain%2Fthird_party%2Fphp_mailer%2Fexamples%2Ftest_gmail.php;h=1fc2c5e80a9f8a07bcb9597ee46612750f0b3840;hb=78a010fef84895720e796842208f01dfb619c332;hp=0000000000000000000000000000000000000000;hpb=7629f2314d517561d4301ddfb068a797b6ed8700;p=core.git diff --git a/framework/main/third_party/php_mailer/examples/test_gmail.php b/framework/main/third_party/php_mailer/examples/test_gmail.php new file mode 100644 index 00000000..1fc2c5e8 --- /dev/null +++ b/framework/main/third_party/php_mailer/examples/test_gmail.php @@ -0,0 +1,50 @@ +getFile('contents.html'); +$body = eregi_replace("[\]",'',$body); + +$mail->IsSMTP(); +$mail->SMTPAuth = true; // enable SMTP authentication +$mail->SMTPSecure = "ssl"; // sets the prefix to the servier +$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server +$mail->Port = 465; // set the SMTP port for the GMAIL server + +$mail->Username = "yourusername@gmail.com"; // GMAIL username +$mail->Password = "yourpassword"; // GMAIL password + +$mail->AddReplyTo("yourusername@gmail.com","First Last"); + +$mail->From = "name@yourdomain.com"; +$mail->FromName = "First Last"; + +$mail->Subject = "PHPMailer Test Subject via gmail"; + +//$mail->Body = "Hi,
This is the HTML BODY
"; //HTML Body +$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test +$mail->WordWrap = 50; // set word wrap + +$mail->MsgHTML($body); + +$mail->AddAddress("whoto@otherdomain.com", "John Doe"); + +$mail->AddAttachment("images/phpmailer.gif"); // attachment + +$mail->IsHTML(true); // send as HTML + +if(!$mail->Send()) { + echo "Mailer Error: " . $mail->ErrorInfo; +} else { + echo "Message sent!"; +} + +?>