]> git.mxchange.org Git - mailer.git/blob - inc/phpmailer/examples/test1.php
Workaround for WINDOWS-1252 encoded data :(
[mailer.git] / inc / phpmailer / examples / test1.php
1 <?php
2
3 include_once('../class.phpmailer.php');
4
5 $mail    = new PHPMailer();
6
7 $body    = $mail->getFile('contents.html');
8
9 $body    = eregi_replace("[\]","",$body);
10
11 $mail->From     = "name@yourdomain.com";
12 $mail->FromName = "First Last";
13
14 $mail->Subject = "PHPMailer Test Subject";
15
16 $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
17
18 $mail->MsgHTML($body);
19
20 $mail->AddAddress("whoto@otherdomain.com", "John Doe");
21
22 if(!$mail->Send()) {
23   echo 'Failed to send mail';
24 } else {
25   echo 'Mail sent';
26 }
27
28 ?>