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