<html> <head> <title>ThaiCreate.Com</title> </head> <body> <?php $strTo = "[email protected]"; $strSubject = "Testing send mail"; $strHeader = "From: [email protected]"; $strMessage = "My Body & My Description"; $flgSend = mail($strTo,$strSubject,$strMessage,$strHeader); if($flgSend) { echo "Mail sending."; } else { echo "Mail cannot send."; } ?> </body> </html>
<html> <head> <title>ThaiCreate.Com</title> </head> <body> <?php require_once('class.phpmailer.php'); $mail = new PHPMailer(); $mail->IsHTML(true); $mail->IsSMTP(); $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = ""; // sets the prefix to the servier $mail->Host = "mail.thaicreate.com"; // sets as the SMTP server $mail->Port = 25; // set the SMTP port for the server $mail->Username = "[email protected]"; // username $mail->Password = "password"; // password $mail->From = "[email protected]"; // "[email protected]"; $mail->FromName = "www.ThaiCreate.Com"; // set from Name $mail->Subject = "Test sending mail."; $mail->Body = "Test Mail Description"; $mail->AddAddress("[email protected]", "Weerachai Nukitram"); // to Address $mail->Send(); ?> </body> </html>
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท