Docstoc

PHP send mail via SMTP on windows

Document Sample
PHP send mail via SMTP on windows Powered By Docstoc
					Send Mail SMTP F Windows

F

F F SMTP (Simple Mail Transfer Protocol)

1.

ก

MyComputer

ก Manage

ก

F

Computer Management

2.

Internet Information Services

ก

Default SMTP Virtual Server

ก Properties

3.

ก

F F Default SMTP Virtual Properties

Access

ก

Relay

4. 5.

F F Relay Restrictions ก ก All except ก F F
HTML

ก

OK

PHP F mail

<!--

F

F

sendmail.html -->

<form action="sendmail.php" method="post"> To : <input name="MailTo" type="text" /> <br /> Subject : <input name="MailSubject" type="text" /> <br /> Message : <textarea name="MailMessage" ></textarea> <br /> From : <input name="MailFrom" type="text" /> <br /> <input type="submit" name="submit" value="Submit" /> </form> <!--

F html-->

<?php //

F sendmail.php

F ก form

$MailTo = $_POST['MailTo'] ; $MailFrom = $_POST['MailFrom'] ; $MailSubject = $_POST['MailSubject'] ; $MailMessage = $_POST['MailMessage'] ; $Headers = "MIME-Version: 1.0\r\n" ; $Headers .= "Content-type: text/html; charset=windows-874\r\n" ; F "windows-874" // F F $Headers .= "From: ".$MailFrom." <".$MailFrom.">\r\n" ; $Headers .= "Reply-to: ".$MailFrom." <".$MailFrom.">\r\n" ; $Headers .= "X-Priority: 3\r\n" ; $Headers .= "X-Mailer: PHP mailer\r\n" ; if(mail($MailTo, $MailSubject , $MailMessage, $Headers, $MailFrom)) { F echo "Send Mail True" ; // F }else{ F F F echo "Send Mail False" ; // F } ?>


				
DOCUMENT INFO
Shared By:
Stats:
views:250
posted:10/8/2009
language:English
pages:4
Description: วิธีการส่ง mail ด้วย PHP ผ่าน SMTP บน windows