Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

html formatted email from online form

Status
Not open for further replies.

celesteb

Technical User
Feb 13, 2002
4
ZA
I need to design an on-line admin section : a form that uses the input to generate an html formatted e-mail that mails to addresses that are stored in a database.
(I know that The mail component JMail can perform this function, but I'd prefer not to pay ...)
 
You can also use the CDONT object if you have installed the smtp portion of iis
 
Here is the basic layout to use CDONTS
dim html,shortmail
html = "Email html goes here"
set shortmail = CreateObject("CDONTS.NewMail")
shortmail.From = "a_return_address.com"
shortmail.To = "emailaddress.com"
shortmail.Subject = "Email Subject"
shortmail.BodyFormat = 0
shortmail.MailFormat = 0
shortmail.Importance = 1
shortmail.Body = html
shortmail.Send
set shortmail = Nothing
Most of the parameters here have other options that you can look up at I hope that this helps

Roj
 
Thanks, but my problem isn't posting a form .
It's getting data from an on-line form to slot into an html-formatted template, and that then in turn to email as an html-formatted email to multiple users
(addresses stored in a database)
 
So in that case you take whatever information that you are passing and place it into variables. Then you just format your email into html in the html variable.

html = &quot;<html><body>ect....&quot;
html = html& &quot;</html>&quot;
then you connect to your database extract the email address that you want into a record set. Then run a loop to assign them to a variable called address. Then use the address variable in the shortmail.to, that should get you what you want.

Roj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top