Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,031

HOME > PHP > PHP Forum > ช่วยด้วยค่ะ การส่งเมลล์ STMP ส่งเมลล์ได้ แต่ไม่มีข้อความอะไรเลยค่ะ



 

ช่วยด้วยค่ะ การส่งเมลล์ STMP ส่งเมลล์ได้ แต่ไม่มีข้อความอะไรเลยค่ะ

 



Topic : 092778



โพสกระทู้ ( 5 )
บทความ ( 0 )



สถานะออฟไลน์




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>&copy; 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>




outlook ไม่โชว์ข้อมูลในตัวแปล

ต้องแก้ยังไง ตรงไหนบ้างคะ ขอบคุณค่ะ



Tag : PHP, HTML/CSS, Action Script, Outlook Tools, Windows, Web Service









ประวัติการแก้ไข
2013-03-21 11:01:49
2013-03-21 11:01:59
Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2013-03-21 10:59:59 By : fernbua View : 904 Reply : 2
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

จากตัวอย่างนี้

PHP Sending Email Using Gmail SMTP Account Authentication

ผมเคยเขียนไว้ครับ

Code (PHP)
<?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 GMAIL as the SMTP server
	$mail->Port = 25; // set the SMTP port for the GMAIL server
	$mail->Username = "[email protected]"; // GMAIL username
	$mail->Password = "xxxxxxx"; // GMAIL password
	$mail->From = "[email protected]"; // "[email protected]";
	//$mail->AddReplyTo = "[email protected]"; // Reply
	$mail->FromName = "Mr.Weerachai Nukitram";  // set from Name
	$mail->Subject = "Test sending mail."; 
	$mail->Body = "My Body & <b>My Description</b>";

	$mail->AddAddress("[email protected]", "Mr.Adisorn Boonsong"); // to Address

	$mail->Send(); 
?>







แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-03-21 11:01:08 By : mr.win
 


 

No. 2



โพสกระทู้ ( 5 )
บทความ ( 0 )



สถานะออฟไลน์


ขอบคุณค่ะ ลองแล้วนะคะ แต่มันยังติดค้างอยู่ใน C:\Inetpub\mailroot\Queue ค่ะ
ไม่ยอมเข้า Outlook เลยค่ะ หนักใจมากเลยค่ะ ลูกคนแรกก็ดื้อมากเลยค่ะ

ค้างอยู่ใน C:\Inetpub\mailroot\Queue ต้องแก้ยังไงคะ เพื่อจะให้ mail ไปถึง outlook ช่วยด้วยนะคะ


ประวัติการแก้ไข
2013-03-22 10:52:51
2013-03-22 10:53:06
2013-03-22 10:53:17
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-03-22 10:25:36 By : Mr.Ke
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ช่วยด้วยค่ะ การส่งเมลล์ STMP ส่งเมลล์ได้ แต่ไม่มีข้อความอะไรเลยค่ะ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 00
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่