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,027

HOME > ASP > ASP Forum > ปัญหาเกี่ยวกับการ send e-mail บน Internet Information Services (IIS7)



 

ปัญหาเกี่ยวกับการ send e-mail บน Internet Information Services (IIS7)

 



Topic : 108748



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



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




คือผมต้องการเขียนCode ASP ในการส่งอีเมล์ แต่มีการแจ้ง ERROR บน browser ดังรูป ต้องแก้ไขอย่างไงครับ

500 Internal server error

ผมใช้เครื่อง server: Windows Server 2008 R2 Core Edition ใช้ IIS 7

Code ที่ใช้ในการส่งอีเมล์

Code (ASP)
<html>
<head>
<title>Test Send mail</title>
</head>
<body>
<%
	Dim objMail
	Set objMail = Server.CreateObject("CDO.Message")	
	objMail.Subject = "Test Mail 555"
	objMail.From = "[email protected]"
	objMail.To = "[email protected]"
	objMail.BCC = "[email protected];"
	objMail.TextBody = "Test System Send Email"
	objMail.Send
	set objMail = nothing

%>
</body>
</html>




Tag : ASP, VBScript, WebService, Class Library







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2014-05-29 14:28:43 By : testto View : 2337 Reply : 13
 

 

No. 1



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

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

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

เปิด SMTP แล้วใช่หรือเปล่าครับ ??






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-05-29 14:43:50 By : mr.win
 


 

No. 2



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



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


ไม่ได้เปิด SMTP ที่เครื่อง server แต่ใช้ IP ของ Exchang Server add เข้าไปใน SMTP Server ดังรูป
smtp
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-05-29 15:01:34 By : testto
 

 

No. 3



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

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

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

ลอง Show Error หน่อยครับ ไปเปิด Error ตรง IIS ครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-05-29 15:34:44 By : mr.win
 


 

No. 4



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



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


เปิด show error แล้วนะครับ แต่ยังไม่ได้เลยครับ
asp
error
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-05-29 15:44:25 By : testto
 


 

No. 5



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

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

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

คลิกที่ Icon ชื่อว่า Error Pages -> Edit Feature Settings…-> Detailed errors
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-05-29 15:54:49 By : mr.win
 


 

No. 6



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



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


ตอนนี้ให้ Show error แล้วครับ แต่ยังไม่สามารถส่งอีเมล์ได้ ยังมี error :

CDO.Message.1 error '80040220'

The "SendUsing" configuration value is invalid.

/TestSendEmail/index.asp, line 14


ขอคำแนะนำด้วยครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-05-29 16:22:20 By : testto
 


 

No. 7



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

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

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

อันที่จริงไม่ต้อง Set ตัว SMTP ก็ได้น่ะครับ เพียงแต่ใช้ Code ตัว SMTP ไปยัง Server ปลายทางได้เลยครับ


Code (ASP)
<%
	Dim myMail,HTML,strMsg
		
	Set myMail = Server.CreateObject("CDO.Message")

	'*** If Using Remote Server ***'
	Dim cdoConfig
	Set cdoConfig = myMail.Configuration
	With cdoConfig.Fields 
		.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
		.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "127.0.0.1" 
		.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
		.Update 
	End With 

	myMail.Configuration = cdoConfig

	strMsg = ""
	strMsg = strMsg &"<h1>My Message</h1><br>"
	strMsg = strMsg &"<table width='285' border='1'>"
	strMsg = strMsg &"  <tr>"
	strMsg = strMsg &"	<td><div align='center'><strong>My Message </strong></div></td>"
	strMsg = strMsg &"	<td><div align='center'><font color='red'>My Message</font></div></td>"
	strMsg = strMsg &"	<td><div align='center'><font size='2'>My Message</font></div></td>"
	strMsg = strMsg &"  </tr>"
	strMsg = strMsg &"  <tr>"
	strMsg = strMsg &"	<td><div align='center'>My Message</div></td>"
	strMsg = strMsg &"	<td><div align='center'>My Message</div></td>"
	strMsg = strMsg &"	<td><div align='center'>My Message</div></td>"
	strMsg = strMsg &"  </tr>"
	strMsg = strMsg &"  <tr>"
	strMsg = strMsg &"	<td><div align='center'>My Message</div></td>"
	strMsg = strMsg &"	<td><div align='center'>My Message</div></td>"
	strMsg = strMsg &"	<td><div align='center'>My Message</div></td>"
	strMsg = strMsg &"  </tr>"
	strMsg = strMsg &"</table>"

	
	myMail.From = "Webmaster<[email protected]>"
	myMail.ReplyTo ="[email protected]"
	myMail.To   = "[email protected]"
	myMail.Cc   = "Mr.Surachai Sirisart<[email protected]>"
	myMail.Bcc   = "[email protected]"
	myMail.Subject = "My Subject"
	myMail.HTMLBody = strMsg
		
	myMail.Send
	Response.write ("Mail Sending.")
	Set myMail = Nothing 
%>

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-05-30 09:27:36 By : mr.win
 


 

No. 8



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



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


ผมทำแล้ว แต่ยังติด error อยู่ครับ เพจแสดง error แบบนี้ครับ

error '8004020f'
/TestSendEmail/index.asp, line 59

นี้เป็นโค้ดที่ใช้ครับ
Code (ASP)
<%
	Dim myMail,HTML,strMsg
		
	Set myMail = Server.CreateObject("CDO.Message")

	'*** If Using Remote Server ***'
	Dim cdoConfig
	Set cdoConfig = myMail.Configuration
	With cdoConfig.Fields 
		.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
		.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "127.0.0.1" 
		.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
		.Update 
	End With 

	myMail.Configuration = cdoConfig

	strMsg = ""
	strMsg = strMsg &"<h1>My Message</h1><br>"
	strMsg = strMsg &"<table width='285' border='1'>"
	strMsg = strMsg &"  <tr>"
	strMsg = strMsg &"	<td><div align='center'><strong>My Message </strong></div></td>"
	strMsg = strMsg &"	<td><div align='center'><font color='red'>My Message</font></div></td>"
	strMsg = strMsg &"	<td><div align='center'><font size='2'>My Message</font></div></td>"
	strMsg = strMsg &"  </tr>"
	strMsg = strMsg &"  <tr>"
	strMsg = strMsg &"	<td><div align='center'>My Message</div></td>"
	strMsg = strMsg &"	<td><div align='center'>My Message</div></td>"
	strMsg = strMsg &"	<td><div align='center'>My Message</div></td>"
	strMsg = strMsg &"  </tr>"
	strMsg = strMsg &"  <tr>"
	strMsg = strMsg &"	<td><div align='center'>My Message</div></td>"
	strMsg = strMsg &"	<td><div align='center'>My Message</div></td>"
	strMsg = strMsg &"	<td><div align='center'>My Message</div></td>"
	strMsg = strMsg &"  </tr>"
	strMsg = strMsg &"</table>"

	
	myMail.From = "[email protected]"
	myMail.ReplyTo ="[email protected]"
	myMail.To   = "[email protected]"
	myMail.Cc   = "[email protected]"
	myMail.Bcc   = "[email protected]"
	myMail.Subject = "My Subject"
	myMail.HTMLBody = strMsg
		
	myMail.Send
	Response.write ("Mail Sending.")
	Set myMail = Nothing 
%>


บรรทัดที่ error คือ myMail.Send ครับ
ช่วนแนะนำด้วยนะครับ


ประวัติการแก้ไข
2014-05-31 10:27:16
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-05-31 10:20:36 By : testto
 


 

No. 9



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



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


เพิ่มเติมครับ

บรรทัดที่ error คือ คำสั่ง myMail.Send ครับ

ผมไม่รู้ว่าทำไมถึง send ไม่ได้ ช่วยแนะนำหน่อยนะคับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-05-31 10:26:17 By : testto
 


 

No. 10



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



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

ดูเรือ่งของ SMTP server ให้ดีครับ ปัญหาส่วนมากเกิดจากไม่สามารถส่งได้เพราะ SMTP server ครับ
Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "127.0.0.1" < ตรงนี้เปลี่ยนเป็น SMTP ของ ISP ที่เราใช้อยู่ดํครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-05-31 10:55:10 By : JDeE
 


 

No. 11



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



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


ผมแก้ปัญหาด้านบนแล้ว แต่ก็มาติด Error อีกตัว....ครับ

CDO.Message.1 error '80070005'

Access is denied.

/TestSendEmail/Sendmail.asp, line 9

ผู้มีความรู้ช่วยหน่อยนะครับ....ผมทำมาหลายวันแล้ว ส่งเมล์ไม่ได้สักที
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-05-31 16:07:43 By : testto
 


 

No. 12

Guest


น่าจะเป็นปัญหาแบบผมนะคับ

4.iis ตั้งแต่ version 6 - 7 ไม่อนุญาติให้ใช้ Parentpath
หากท่านยังพอจำได้ว่าการอ้างอิง path สามารถระบุคำสั่งใน asp เพื่อถอยออกมาจาก folder ทีละ 1 ชั้นแล้วเรียกใช้ file ที่ต้องการ
โดยการระบุ "../" หากมี folder หลายชั้นก็ใช้ "../../../abc.asp"
เช่นนี้ หมายถึงถอยออกจาก folder ปัจจุบัน 3 ชั้นแล้วเรียกใช้ file ชื่อ abc.asp
หากจำเป็นต้องการใช้สามารถแก้ไขได้โดยการ ระบุคำสั่งลงไปดังนี้..... อ่านต่อได้ที่: https://www.gotoknow.org/posts/170209
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-11-15 09:44:27 By : yo
 


 

No. 13



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



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


SMTP ที่ Server เปิดไว้หรือลงไว้หรือยังครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-11-24 11:04:03 By : Ferio
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ปัญหาเกี่ยวกับการ send e-mail บน Internet Information Services (IIS7)
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ 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 04
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 อัตราราคา คลิกที่นี่