01.
<html>
02.
<head>
03.
<title>ThaiCreate.Com Tutorial</title>
04.
</head>
05.
<body>
06.
<?php
07.
require_once
(
'class.phpmailer.php'
);
08.
$mail
=
new
PHPMailer();
09.
$mail
->IsHTML(true);
10.
$mail
->IsSMTP();
11.
$mail
->SMTPAuth = true;
12.
$mail
->SMTPSecure =
"ssl"
;
13.
$mail
->Host =
"smtp.gmail.com"
;
14.
$mail
->Port = 465;
15.
$mail
->Username =
"email@gmail.com"
;
16.
$mail
->Password =
"password"
;
17.
$mail
->From =
"name@yourdomain.com"
;
18.
19.
$mail
->FromName =
"Your Name"
;
20.
$mail
->Subject =
"Test sending mail."
;
21.
$mail
->Body =
"My Body & <b>My Description</b>"
;
22.
23.
$mail
->AddAddress(
"address@hotmail.com"
,
"Mr.Adisorn Boonsong"
);
24.
25.
26.
27.
28.
29.
30.
31.
$mail
->set(
'X-Priority'
,
'1'
);
32.
33.
$mail
->Send();
34.
?>
35.
</body>
36.
</html>