test_smtp.php
Go to the documentation of this file.00001 <?php
00002
00003
00004 error_reporting(E_STRICT);
00005
00006 date_default_timezone_set('America/Toronto');
00007
00008
00009 include_once('class.phpmailer.php');
00010
00011
00012 $mail = new PHPMailer();
00013
00014 $body = $mail->getFile('contents.html');
00015 $body = eregi_replace("[\]",'',$body);
00016
00017 $mail->IsSMTP();
00018 $mail->Host = "mail.worxteam.com";
00019
00020 $mail->From = "name@yourdomain.com";
00021 $mail->FromName = "First Last";
00022
00023 $mail->Subject = "PHPMailer Test Subject via smtp";
00024
00025 $mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
00026
00027 $mail->MsgHTML($body);
00028
00029 $mail->AddAddress("whoto@otherdomain.com", "John Doe");
00030
00031 $mail->AddAttachment("images/phpmailer.gif");
00032
00033 if(!$mail->Send()) {
00034 echo "Mailer Error: " . $mail->ErrorInfo;
00035 } else {
00036 echo "Message sent!";
00037 }
00038
00039 ?>