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