PDA

View Full Version : script for sending a form?



darco9x2
03-21-2005, 04:43 AM
i just figured out i need asp to send a form via email, i found one at w3schools:

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="mymail@mydomain.com"
myMail.To="someone@somedomain.com"
myMail.HTMLBody = "<h1>This is a message.</h1>"
myMail.Send
%>
would i chage HTMLBody to HTMLForm? or am i totally wrong?
thanks..

mwinter
03-21-2005, 01:18 PM
Before I start, I just want to point out that I've never touched ASP (nor do I have any intention to do so). I'm just looking through the MSDN documentation I have on my machine.


i just figured out i need asp to send a form via email, i found one at w3schools:

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="mymail@mydomain.com"
myMail.To="someone@somedomain.com"
myMail.HTMLBody = "<h1>This is a message.</h1>"
myMail.Send
%>
would i chage HTMLBody to HTMLForm? or am i totally wrong?
thanks..No. There are two ways to include content in a message: the HTMLBody string, and the TextBody string. I think you can guess the difference between the two.

Once you've received the request sent by the user, you should be able to use the Request.Form collection to access the data submitted, validate and format it, then assign it to one of the two previous properties.

Incidentally, you could send a multi-part message which includes both HTML and a text alternative, but I'll leave you to look that up yourself.

Mike

darco9x2
03-22-2005, 12:11 AM
ok, i finally figured it out, and my host doesnt support asp, do you know a host that supports it?

mwinter
03-23-2005, 09:59 AM
ok, i finally figured it out, and my host doesnt support asp, do you know a host that supports it?I'm afraid I don't. As I said, I want nothing to do with ASP so I've never looked for a host that supports it.

Mike