Log in

View Full Version : ASP Email Script Problem:(



gerardobrien
03-08-2008, 07:19 PM
hi there, i pretty new to ASP and trying to learn it as i go along, i'm having some trouble with the following email script. This is the error thats showing up: Anyone any ideas?



Microsoft VBScript runtime error '800a01b6'

Object doesn't support this property or method: 'Body'

/gerardob/contactconfirmation.asp, line 56



<%

Dim objEmail, sName, sEmail, sSubkject, sMessage, sAnswer, sMyMail

sMyMail="obrien.g@gmail.com"

'get form data
sName = request.Form("name")
sEmail = request.Form("email")
sSubject = request.Form("subject")
sMessage = "Message from form:" & Chr(13) & Chr(10) & Chr(10) & "Name : " & sName & Chr(13) & Chr(10) & Chr(10) & request.Form("message")

'you can modify the text into whatever you want
sAnswer="Dear " & sName & Chr(13) & Chr(10) & Chr(10)
sAnswer=sAnswer & "Thank you for filling out the form on our website." & Chr(13) & Chr(10)
sAnswer=sAnswer & "We will contact you as soon as possible concerning your matters." & Chr(13) & Chr(10) & Chr(10)
sAnswer=sAnswer & "Kind regards," & Chr(13) & Chr(10) & "Manager (CaledonianKeady.com)"

'Form mailed to you
Set objEmail = CreateObject("CDO.Message")
objEmail.From = sEmail
objEmail.To = sMyMail
objEmail.Subject = sSubject
objEmail.Body = sMessage
objEmail.Send
set objEmail=nothing




'A confirmation sent to the customer/client/whoeveR

Set objEmail = CreateObject("CDO.Message")
objEmail.From = sMyMail
objEmail.To = sEmail
objEmail.Subject = "Re: " & sSubject
objEmail.Body = sAnswer
objEmail.Send
set objEmail=nothing
%>

dotnetclassic
03-13-2008, 06:09 AM
if u want dotnet code click following link

http://dotnetclassic.com/post/Send-Email-With-Asp-Net.aspx

dcstow
03-13-2008, 11:40 PM
Swap


...
objEmail.Body = sMessage
...
objEmail.Body = sAnswer


For


...
objEmail.TextBody = sMessage
...
objEmail.TextBody = sAnswer

And see how you go.

dubya008
04-02-2008, 03:43 PM
um... i may be wrong but look at this

Dim objEmail, sName, sEmail, sSubkject, sMessage, sAnswer, sMyMail

and now look at this

sSubject = request.Form("subject")

Your missing the "k"