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

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


 

[ASP] ปัญหาเกี่ยวกับการ 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)
01.<html>
02.<head>
03.<title>Test Send mail</title>
04.</head>
05.<body>
06.<%
07.    Dim objMail
08.    Set objMail = Server.CreateObject("CDO.Message")   
09.    objMail.Subject = "Test Mail 555"
10.    objMail.From = "chanaphon@hotmail.com"
11.    objMail.To = "chavinrong@hotmail.com"
12.    objMail.BCC = "chanaphon@hotmail.com;"
13.    objMail.TextBody = "Test System Send Email"
14.    objMail.Send
15.    set objMail = nothing
16. 
17.%>
18.</body>
19.</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 : 2454 Reply : 13
 

 

No. 1



โพสกระทู้ ( 74,059 )
บทความ ( 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,059 )
บทความ ( 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,059 )
บทความ ( 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,059 )
บทความ ( 838 )

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

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

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


Code (ASP)
01.<%
02.    Dim myMail,HTML,strMsg
03.         
04.    Set myMail = Server.CreateObject("CDO.Message")
05. 
06.    '*** If Using Remote Server ***'
07.    Dim cdoConfig
08.    Set cdoConfig = myMail.Configuration
09.    With cdoConfig.Fields
11.        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "127.0.0.1"
13.        .Update
14.    End With
15. 
16.    myMail.Configuration = cdoConfig
17. 
18.    strMsg = ""
19.    strMsg = strMsg &"<h1>My Message</h1><br>"
20.    strMsg = strMsg &"<table width='285' border='1'>"
21.    strMsg = strMsg &"  <tr>"
22.    strMsg = strMsg &"  <td><div align='center'><strong>My Message </strong></div></td>"
23.    strMsg = strMsg &"  <td><div align='center'><font color='red'>My Message</font></div></td>"
24.    strMsg = strMsg &"  <td><div align='center'><font size='2'>My Message</font></div></td>"
25.    strMsg = strMsg &"  </tr>"
26.    strMsg = strMsg &"  <tr>"
27.    strMsg = strMsg &"  <td><div align='center'>My Message</div></td>"
28.    strMsg = strMsg &"  <td><div align='center'>My Message</div></td>"
29.    strMsg = strMsg &"  <td><div align='center'>My Message</div></td>"
30.    strMsg = strMsg &"  </tr>"
31.    strMsg = strMsg &"  <tr>"
32.    strMsg = strMsg &"  <td><div align='center'>My Message</div></td>"
33.    strMsg = strMsg &"  <td><div align='center'>My Message</div></td>"
34.    strMsg = strMsg &"  <td><div align='center'>My Message</div></td>"
35.    strMsg = strMsg &"  </tr>"
36.    strMsg = strMsg &"</table>"
37. 
38.     
39.    myMail.From = "Webmaster<webmaster@thaicreate.com>"
40.    myMail.ReplyTo ="thaicreate@hotmail.com"
41.    myMail.To   = "member@thaicreate.com"
42.    myMail.Cc   = "Mr.Surachai Sirisart<member@thaicreate.com>"
43.    myMail.Bcc   = "webmaster@thaicreate.com"
44.    myMail.Subject = "My Subject"
45.    myMail.HTMLBody = strMsg
46.         
47.    myMail.Send
48.    Response.write ("Mail Sending.")
49.    Set myMail = Nothing
50.%>

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
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)
01.<%
02.    Dim myMail,HTML,strMsg
03.         
04.    Set myMail = Server.CreateObject("CDO.Message")
05. 
06.    '*** If Using Remote Server ***'
07.    Dim cdoConfig
08.    Set cdoConfig = myMail.Configuration
09.    With cdoConfig.Fields
11.        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "127.0.0.1"
13.        .Update
14.    End With
15. 
16.    myMail.Configuration = cdoConfig
17. 
18.    strMsg = ""
19.    strMsg = strMsg &"<h1>My Message</h1><br>"
20.    strMsg = strMsg &"<table width='285' border='1'>"
21.    strMsg = strMsg &"  <tr>"
22.    strMsg = strMsg &"  <td><div align='center'><strong>My Message </strong></div></td>"
23.    strMsg = strMsg &"  <td><div align='center'><font color='red'>My Message</font></div></td>"
24.    strMsg = strMsg &"  <td><div align='center'><font size='2'>My Message</font></div></td>"
25.    strMsg = strMsg &"  </tr>"
26.    strMsg = strMsg &"  <tr>"
27.    strMsg = strMsg &"  <td><div align='center'>My Message</div></td>"
28.    strMsg = strMsg &"  <td><div align='center'>My Message</div></td>"
29.    strMsg = strMsg &"  <td><div align='center'>My Message</div></td>"
30.    strMsg = strMsg &"  </tr>"
31.    strMsg = strMsg &"  <tr>"
32.    strMsg = strMsg &"  <td><div align='center'>My Message</div></td>"
33.    strMsg = strMsg &"  <td><div align='center'>My Message</div></td>"
34.    strMsg = strMsg &"  <td><div align='center'>My Message</div></td>"
35.    strMsg = strMsg &"  </tr>"
36.    strMsg = strMsg &"</table>"
37. 
38.     
39.    myMail.From = "webmaster@maxxis.co.th"
40.    myMail.ReplyTo ="webmaster@maxxis.co.th"
41.    myMail.To   = "chanaphorn@maxxis.co.th"
42.    myMail.Cc   = "chavinrong@maxxis.co.th"
43.    myMail.Bcc   = "webmaster@maxxis.co.th"
44.    myMail.Subject = "My Subject"
45.    myMail.HTMLBody = strMsg
46.         
47.    myMail.Send
48.    Response.write ("Mail Sending.")
49.    Set myMail = Nothing
50.%>


บรรทัดที่ 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 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)





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