PDA

View Full Version : Sending HTML form info to ASP mailing form? Please Help!



Steveo31
January 19th, 2004, 09:07 PM
Hey all-

I have seen a few sites that use this method as opposed to a straight up "mailto:_____" in the action of the form method:

<FORM METHOD="post" ACTION="mailto:you@email.com" ENCTYPE="text/plain">
Instead, I have seen this way:

<form action="invoicesub.asp" method="POST" name="register" align="center">
I assume in the above example, they send the info in the form to the "invoicesub.asp" which then emails it, correct? Would one of you be kind enoughto send a link or a sample with commentary? I have searched, but haven't found anything.

I don't know much ASP, or any for that matter, I know some PHP, and a bit of HTML. Thanks all.

-Steve

Dream
January 21st, 2004, 01:11 PM
You can use ASP to send emails and it work much better than the mailto: method.

Here's an example using CDONTS to send an HTML email:





Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = "webmaster@site.com"
objMail.Subject = "Email Subject Here"
objMail.To = "Send to email"
objMail.Body = "<html>" &_
"<BODY> Email Message Here</body></html>"
objMail.BodyFormat = 0
objMail.MailFormat = 0
objMail.Send
set objMail = nothing

desman
January 22nd, 2004, 03:07 PM
If itís on a Win 2003 server you can no longer use CDONT (well it doesnít come installed by default) so CDO is the alternative.


Dim objMail

Set objMail = CreateObject("CDO.Message")

objMail.From = "webmaster@domain.com"
objMail.To = "user@domain.com"
objMail.Subject = "Welcome to our service"
objMail.TextBody = "Testing Email services on server."

objMail.Send
Set objMail = Nothing


Hope this helps

Steveo31
January 29th, 2004, 04:22 PM
Ahh thanks all :)

Just curious, what does CDO and CDONT stand for?