Lunarpages Web Hosting Forum

Author Topic: need help with asp cdosys code please  (Read 4791 times)

Offline jadeflo

  • Trekkie
  • **
  • Posts: 13
need help with asp cdosys code please
« on: July 28, 2009, 04:57:13 PM »
Hi, I'm pretty new with code and I am slowly working my way to get my form working properly on my web site, I want to get the information mail to me when people hit the submit button of my contact form, but now I get an error message when I clic the submit button : 500 Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

if someone could tell me what is wrong with my code I would be so happy and thankful you don't know how much!, so here is my code, my file name is :good.asp and the code is:

' send by connecting to port 25 of the SMTP server
smtpserver = ""
youremail = ""
yourpassword = "I typed my password but removed it for the forum"

Dim iMsg
Dim iConf
Dim Flds
Dim strHTML
Dim strSmartHost

Const cdoSendUsingPort = 2
StrSmartHost = "localhost"

set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")

Set Flds = iConf.Fields

' set the CDOSYS configuration fields to use port 25 on the SMTP server

With Flds
.Item("") = cdoSendUsingPort
.Item("") = strSmartHost
.Item("") = 60
End With

' build HTML for message body
strHTML = "Earhart Refrigeration contact form submission from "
strHTML = strHTML & request.form("realname") & "." & "<br /><br />"
strHTML = strHTML & request.form("message")

' apply the settings to the message
With iMsg
Set .Configuration = iConf
.To = ""
.From =
.Subject = request.form("subject")
.HTMLBody = strHTML
End With

' cleanup of variables
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing

so like I said, coding like this is abit like chinese to me, but if you see what is wrong here, please tell me !

thank you

Offline jadeflo

  • Trekkie
  • **
  • Posts: 13
Re: need help with asp cdosys code please
« Reply #1 on: August 03, 2009, 04:47:26 PM »
well, nobody replied to my post, but I see that over a hundred people read it, so if it can help some of you, I figured out how to make my form work and I wrote the code in another post which is :   
 Lunarpages Web Hosting - Online Help Desk / Lunarpages - Beginner Assistance / Re: form help on windows shared hosting, ...please!
 So if you are trying to get your cdosys code working, go check it out, it might work for you too, and if you have questions about it, post it, maybe I can anwser you.

right now I am trying to find out how to redirect people to my : thank you for joining our mailing list page    when they clic the submit button of the form, if you have any clue of where to write that in the code, please don't be shy to share it with me!

(and sorry if my english is not perfect, I am mostly french speaking...)