Sending mail with ASP
I have now completed my guestbook, wich I have had a lot of help with, in the group here, but I would like to recieve an email every time someone signs the guestbook!
What I need is a simple script, that sends the information on, from the forms, or variables, or whatever will be the easyest..
I know that this can be done using CGI, but I hope that you can do it with ASP as well...
I hope that you can help me with this simple question
Casper
Mark Hensler posted this at 23:17 — 12th October 2000.
He has: 4,048 posts
Joined: Aug 2000
heres the syntax:
Set objNewMail = CreateObject("CDONTS.NewMail")
objNewMail.From = "[email protected]"
objNewMail.To = "[email protected]"
objNewMail.Subject = "My subject"
objNewMail.Body = "the message or body of the email"
objNewMail.Send (
(optional) From as String,
(optional) To as String,
(optional) Subject as String,
(optional) Body as Object or String,
(optional) Importance as Long
)
you can leave 'objNewMail.Send()' empty like this, or actually put the stuff right in the (). I prefer to leave it empty and define my stuff by using 'objNewMail.something'
You can aso use the following:
Bcc, Body, BodyFormat, Cc, ContentBase, ContentLocation, From, Importance, MailFormat, Subject, To, Value, Version
Mark Hensler
If there is no answer on Google, then there is no question.
hotcut posted this at 12:29 — 13th October 2000.
They have: 133 posts
Joined: Sep 2000
I have offcourse tried out the script, but Iit wont work...
I started with using the exackt same code as you gave me, but recieved an error. Then I tried removing the (optional) in the front of the words, same error... Then I tried putting the obj.NewMail... inside the objNewMail.Send tag, but I still recieved an error...
I know that it is me, that missunderstod you, but where did you missunderstand you?
Just to show you the lates error message I got, here it is:
/gbproc.asp, linje 61
objNewMail.Send (
-----------------^
Why exacktly is it doing that?
I hope that you can give me a more exackt code, of how to make it work, remember, I am just a newbie
Thanks again Mark for all the help you have given me so far
Casper
Mark Hensler posted this at 21:51 — 13th October 2000.
He has: 4,048 posts
Joined: Aug 2000
that was just a template (syntax)..
try this
Set objNewMail = CreateObject("CDONTS.NewMail")
objNewMail.From = Request.Form("email")
objNewMail.To = "[email protected]"
objNewMail.Subject = "Guestbook signed"
objNewMail.Body = "Name: " & Request.Form("name") & vbCrLf &_
"Email: " & Request.Form("email") & vbCrLf &_
"Homepage: " & Request.Form("homepage") & vbCrLf &_
"ICQ: " & Request.Form("icq") & vbCrLf &_
"Time: " & Request.Form("time") & vbCrLf &_
"Comments: " & vbCrLf &_ Request.Form("comment")
objNewMail.Send ()
I haven't tested this, but it *should* work. I used the variables from your other post. You just need to chane '[email protected]' to the email you want this sent to.
Mark Hensler
If there is no answer on Google, then there is no question.
hotcut posted this at 06:48 — 14th October 2000.
They have: 133 posts
Joined: Sep 2000
I think that I will have to forget the idea, of sending mail with ASP... Right now I have my ASP on brinkster.com, and guess what! They dont support email
I am starting to gte very p***** off! Firsr I changed from domaindlx to brinkster, becourse I needed scripting.filesystemobjeckt, now it is domaindlx that supports mail, so I would have to change again... but domaindlx wants a banner, so that is out of the question...
I think that I better cobsidder bying my own server...
Thanks for your help anyway...
Mark Hensler posted this at 07:14 — 14th October 2000.
He has: 4,048 posts
Joined: Aug 2000
I know the felling... I've got a host know, but I went years without one (using the free stuff). It was after I got a real host that my programming knowledge really started to grow stedily.
Good luck finding a solution!
Mark Hensler
If there is no answer on Google, then there is no question.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.