]> git.mxchange.org Git - shipsimu.git/blob - inc/classes/third_party/php_mailer/examples/test_sendmail.php
38eb78d592dd2054adfbdb52fdaa480f730293cc
[shipsimu.git] / inc / classes / third_party / php_mailer / examples / test_sendmail.php
1 <?php\r
2 \r
3 //error_reporting(E_ALL);\r
4 error_reporting(E_STRICT);\r
5 \r
6 \r
7 date_default_timezone_set('America/Toronto');\r
8 //date_default_timezone_set(date_default_timezone_get());\r
9 \r
10 include_once('class.phpmailer.php');\r
11 \r
12 $mail             = new PHPMailer();\r
13 $body             = $mail->getFile('contents.html');\r
14 $body             = eregi_replace("[\]",'',$body);\r
15 \r
16 $mail->IsSendmail(); // telling the class to use SendMail transport\r
17 \r
18 $mail->From       = "name@yourdomain.com";\r
19 $mail->FromName   = "First Last";\r
20 \r
21 $mail->Subject    = "PHPMailer Test Subject via smtp";\r
22 \r
23 $mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test\r
24 \r
25 $mail->MsgHTML($body);\r
26 \r
27 $mail->AddAddress("whoto@otherdomain.com", "John Doe");\r
28 \r
29 $mail->AddAttachment("images/phpmailer.gif");             // attachment\r
30 \r
31 if(!$mail->Send()) {\r
32   echo "Mailer Error: " . $mail->ErrorInfo;\r
33 } else {\r
34   echo "Message sent!";\r
35 }\r
36 \r
37 ?>\r