01.
<?php
02.
03.
include_once
(
'../class.phpmailer.php'
);
04.
05.
06.
$mail
=
new
PHPMailer();
07.
08.
$body
=
$mail
->getFile(
'contents.html'
);
09.
10.
11.
$mail
->From =
"Noo_Bloo29@hotmail.com"
;
12.
$mail
->FromName =
"First Last"
;
13.
14.
$mail
->Subject =
"PHPMailer Test Subject via mail()"
;
15.
16.
$mail
->AltBody =
"To view the message, please use an HTML compatible email viewer!"
;
17.
18.
$mail
->MsgHTML(
$body
);
19.
20.
$mail
->AddAddress(
"teenza_krub@hotmail.com"
,
"John Doe"
);
21.
22.
$mail
->AddAttachment(
"images/phpmailer.gif"
);
23.
24.
if
(!
$mail
->Send()) {
25.
echo
"Mailer Error: "
.
$mail
->ErrorInfo;
26.
}
else
{
27.
echo
"Message sent!"
;
28.
}
29.
30.
?>