  | 
		 		   | 
	  	    
          
            
			
	
			
			 
                form กรอกข้อมูล   Index.html 
 
Code (PHP) 
<!DOCTYPE HTML>
<!--
	Astral 1.0 by HTML5 Up!
	html5up.net | @n33co
	Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<html>
	<head>
		<title> TESTT</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<meta name="description" content="" />
		<meta name="keywords" content="" />
		<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400" rel="stylesheet" />
		<script src="js/jquery-1.9.1.min.js"></script>
		<script src="css/5grid/init.js?use=mobile,desktop"></script>
		<script src="js/jquery.formerize-1.1.js"></script>
		<script src="js/init.js"></script>
		<noscript>
			<link rel="stylesheet" href="css/5grid/core.css" />
			<link rel="stylesheet" href="css/5grid/core-desktop.css" />
			<link rel="stylesheet" href="css/5grid/core-1200px.css" />
			<link rel="stylesheet" href="css/5grid/core-noscript.css" />
			<link rel="stylesheet" href="css/style.css" />
			<link rel="stylesheet" href="css/style-desktop.css" />
			<link rel="stylesheet" href="css/noscript.css" />
		</noscript>
		<!--[if lte IE 8]><link rel="stylesheet" href="css/ie8.css" /><![endif]-->
	</head>
	<body class="homepage">
		<!-- Wrapper-->
			<div id="wrapper">
				
				<!-- Nav -->
					<nav id="nav">
						<a href="#email" class="icon icon-mail"><span>Email</span></a>
					</nav>
				<!-- Main -->
					<div id="main">
						<!-- Email -->
							<article id="email" class="panel">
								<header>
									<h2>Email Me</h2>
								</header>
								<form method="post" action="test01.php" enctype="text/plain" >   
									<div class="5grid">
										<div class="row">
											<div class="6u">
												<input type="text" class="text" name="namefrom" placeholder="Name" />
											</div>
											<div class="6u">
												<input type="email" class="text" name="from" placeholder="Email" />
											</div>
										</div>
										<div class="row">
											<div class="12u">
												<input type="text" class="text" name="subject" placeholder="Phone Number" />
											</div>
										</div>
										<div class="row">
											<div class="12u">
												<textarea name="message" placeholder="Message"></textarea>
											</div>
										</div>
										<div class="row">
											<div class="12u">
												<input type="submit" class="button" value="Send Message" />
												<input type="reset" class="button" value="Clear Message" />
											</div>
										</div>
									</div>
								</form>
							</article>
					</div>
		
				<!-- Footer -->
					<div id="footer">
						<ul class="links">
							<li>© Jane Doe</li>
							<li>Images : <a href="http://fotogrph.com/">fotogrph</a></li>
							<li>Design : <a href="http://html5up.net/">HTML5 Up!</a></li>
						</ul>
					</div>
		
			</div>
	</body>
</html>
  
 
 
form action ค่ะ  
เอา Code นี้ มาจากทางเว็บนี้ค่ะ แต่ว่า ลองทำดูแล้ว ค่าในตัวแปรก็ไม่โชว์ใน outlook 
 
 test01.php 
 
Code (PHP) 
<html>
<head>
<title>ThaiCreate.Com Tutorial</title>
</head>
<body>
<?php
function authMail($from, $namefrom, $to, $nameto, $subject, $message)
{
	/*?your configuration here?*/
	$smtpServer = "mail.xxx.co.th";
	$port = "25";
	$timeout = "30";
	$username = ""; 
	$password = ""; 
	$localhost = "localhost"; 
	$newLine = "\r\n"; 
	$secure = 1;
	/*?you shouldn't need to mod anything else */
	//connect to the host and port
	$smtpConnect = fsockopen($smtpServer, $port, $errno, $errstr, $timeout);
	$smtpResponse = fgets($smtpConnect, 4096);
	if(empty($smtpConnect))
	{
		$output = "Failed to connect: $smtpResponse";
		return $output;
	}
	else
	{
		$logArray['connection'] = "Connected to: $smtpResponse";
	}
	//say HELO to our little friend
	fputs($smtpConnect, "HELO $localhost". $newLine);
	$smtpResponse = fgets($smtpConnect, 4096);
	$logArray['heloresponse'] = "$smtpResponse";
	//start a tls session if needed 
	if($secure)
	{
		fputs($smtpConnect, "STARTTLS". $newLine);
		$smtpResponse = fgets($smtpConnect, 4096);
		$logArray['tlsresponse'] = "$smtpResponse";
		
		//you have to say HELO again after TLS is started
		fputs($smtpConnect, "HELO $localhost". $newLine);
		$smtpResponse = fgets($smtpConnect, 4096);
		$logArray['heloresponse2'] = "$smtpResponse";
	}
	//request for auth login
	fputs($smtpConnect,"AUTH LOGIN" . $newLine);
	$smtpResponse = fgets($smtpConnect, 4096);
	$logArray['authrequest'] = "$smtpResponse";
	//send the username
	fputs($smtpConnect, base64_encode($username) . $newLine);
	$smtpResponse = fgets($smtpConnect, 4096);
	$logArray['authusername'] = "$smtpResponse";
	//send the password
	fputs($smtpConnect, base64_encode($password) . $newLine);
	$smtpResponse = fgets($smtpConnect, 4096);
	$logArray['authpassword'] = "$smtpResponse";
	//email from
	fputs($smtpConnect, "MAIL FROM: $from" . $newLine);
	$smtpResponse = fgets($smtpConnect, 4096);
	$logArray['mailfromresponse'] = "$smtpResponse";
	//email to
	fputs($smtpConnect, "RCPT TO: $to" . $newLine);
	$smtpResponse = fgets($smtpConnect, 4096);
	$logArray['mailtoresponse'] = "$smtpResponse";
	//the email
	fputs($smtpConnect, "DATA" . $newLine);
	$smtpResponse = fgets($smtpConnect, 4096);
	$logArray['data1response'] = "$smtpResponse";
	//construct headers
	$headers = "MIME-Version: 1.0" . $newLine;
	//$headers .= "Content-type: text/html; charset=iso-8859-1" . $newLine;
	$headers .= "To: $nameto <$to>" . $newLine;
	$headers .= "From: $namefrom <$from>" . $newLine;
	//observe the . after the newline, it signals the end of message
	fputs($smtpConnect, "To: $to\r\nFrom: $from\r\nSubject: $subject\r\n$headers\r\n\r\n$message\r\n.\r\n");
	$smtpResponse = fgets($smtpConnect, 4096);
	$logArray['data2response'] = "$smtpResponse";
	// say goodbye
	fputs($smtpConnect,"QUIT" . $newLine);
	$smtpResponse = fgets($smtpConnect, 4096);
	$logArray['quitresponse'] = "$smtpResponse";
	$logArray['quitcode'] = substr($smtpResponse,0,3);
	fclose($smtpConnect);
	//a return value of 221 in $retVal["quitcode"] is a success 
	return($logArray);
}
$from = $_POST['from'] ;
$namefrom = $_POST['namefrom'] ;
$to = "[email protected]";
$nameto = "Mr.Support";
$subject = $_POST['subject'] ;
$message = $_POST['message'] ;  
authMail($from, $namefrom, $to, $nameto, $subject, $message);
?>
</body>
</html>
 
 
 
  
 
ต้องแก้ยังไง ตรงไหนบ้างคะ ขอบคุณค่ะ
 
 
  Tag : PHP, HTML/CSS, Action Script, Outlook Tools, Windows, Web Service               
                        | 
           
          
            
		
  ประวัติการแก้ไข 2013-03-21 11:01:49 2013-03-21 11:01:59	
                             | 
           
          
            
              
                   | 
                   | 
                   | 
               
              
                   | 
                
                    
                      | Date :
                          2013-03-21 10:59:59 | 
                      By :
                          fernbua | 
                      View :
                          999 | 
                      Reply :
                          2 | 
                     
                  | 
                   | 
               
              
                   | 
                   | 
                   | 
               
              | 
           
          
            | 
			 | 
           
         
	    
		             | 
		
			  |