By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,454 Members | 1,803 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,454 IT Pros & Developers. It's quick & easy.

NewMailobj.Send gives me 500 INTERNAL ERROR

P: 1
I keep getting this error on my form code, but only when I keep the MailNewObj.Send in the code, so I know it is this... I get the 500 INTERNAL ERROR message.. I tried shutting off "friendly messages" in IE, but it still winds up with the same message... I am publishing to GoDaddy and the GoDaddy server is ASP/LINUX since I wanted a combination of both... GoDaddy mentioned I should add the following lines, somewhere in my code:OUTGOING SERVER = relay-hosting.secureserver.net

Any help would be appreciated...

ENTIRE CODE:
<%@ Language="VBscript" %>
<% Option Explicit %>

<html>
<head>
<title>Message Sent</title>
</head>

<body>
<%
'declare the variables that will receive the values
'receive the values sent from the form and assign them to variables
'note that request.form("name") will receive the value entered into the textfield
'called name, and so with email and message
Dim first, last, phone, email
Dim eventdate, eventtype, eventlocation, message, NewMailObj

first=request.form("first")
last=request.form("last")
phone=request.form("phone")
email=request.form("email")
eventdate=request.form("eventdate")
eventtype=request.form("eventtype")
eventlocation=request.form("eventlocation")
message=request.form("message")

'create the mail object and send the details
Set NewMailObj=Server.CreateObject("CDONTS.NewMail")
NewMailObj.From = "events@settevideoproductions.com"
NewMailObj.To = "events@settevideoproductions.com"
NewMailObj.Subject = "NEW MESSAGE FROM SETTEVIDEOPRODUCTIONS.COM"
NewMailObj.Body = "First Name: " & first & _
"<br>Last Name: " & last & _
"<br>Phone: " & phone & _
"<br>E-mail: " & email & _
"<br>Event Date: " & eventdate & _
"<br>Event Type: " & eventtype & _
"<br>Event Location: " & eventlocation & _
"<br>Message: " & message

'you need to add the following lines FOR the mail to be sent in HTML format
NewMailObj.BodyFormat = 0
NewMailObj.MailFormat = 0
'The next line gives me an error if I keep it in... it is necessary to send the mail out
NewMailObj.Send

'Close the email object and free up resources
Set NewMailObj = nothing
Response.Redirect "http://www.settevideoproductions.com/thankyou.html"
%>

</body>
</html>
Dec 4 '08 #1
Share this Question
Share on Google+
1 Reply


CroCrew
Expert 100+
P: 563
Hello Michael31277,

Try using this code in place of the code you pasted.

Hope this helps,
CroCrew~

Expand|Select|Wrap|Line Numbers
  1. <html>
  2.     <head>
  3.         <title>Message Sent</title>
  4.     </head>
  5.     <body>
  6.         <%
  7.             Function MailBody()
  8.                 MailBody = "--- Information --" & vbCrLf
  9.                 MailBody = MailBody & "First Name: " &         Request.Form("first") & vbCrLf
  10.                 MailBody = MailBody & "Last Name: " &         Request.Form("last") & vbCrLf
  11.                 MailBody = MailBody & "Phone: " &             Request.Form("phone") & vbCrLf
  12.                 MailBody = MailBody & "Email: " &             Request.Form("email") & vbCrLf
  13.                 MailBody = MailBody & "Event Date: " &         Request.Form("eventdate") & vbCrLf
  14.                 MailBody = MailBody & "Event Type: " &         Request.Form("eventtype") & vbCrLf
  15.                 MailBody = MailBody & "Event Location: " &     Request.Form("eventlocation") & vbCrLf
  16.                 MailBody = MailBody & "Message: " &         Request.Form("message") & vbCrLf
  17.             End Function
  18.  
  19.             Set myMail=CreateObject("CDO.Message") 
  20.             myMail.Subject = "NEW MESSAGE FROM SETTEVIDEOPRODUCTIONS.COM" 
  21.             myMail.From = "events@settevideoproductions.com" 
  22.             myMail.To = "events@settevideoproductions.com" 
  23.             myMail.TextBody = MailBody()
  24.  
  25.             On Error Resume Next  
  26.                myMail.Send     
  27.                If Err <> 0 Then  
  28.                   Response.Write("Error occurred: " & Err.Description) 
  29.                else 
  30.                   Response.Write("Your message was sent successfully.") 
  31.                   Response.Redirect "http://www.settevideoproductions.com/thankyou.html"
  32.                End If 
  33.             Response.End         
  34.         %>
  35.     </body>
  36. </html> 
  37.  
Dec 4 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.