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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending Email (HTML) Confirmation using Cdonts 2

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I am making a webpage to sell books. Just before the customer clicks in the submit, it appears a webpage with all the books and the amount to pay. After he clicks "Confirm", im trying to send a confirmation email to him and to the webmaster with the exact same webpage containing all the info about his order. I am having trouble doing this.
The main problem is that each customer has its own product ordered so the content of the confirmation email changes and i dont know how to make an email in HTML format with a variable body.
Can someone help me please? Thank you.
 
Below you will find the entire contents of a page I use to send e-mail notifications. The associated form is on a different page but is just a standard form. Good luck!

<%

SUB sendMail( fromWho, toWho, Subject, myContent )
DIM myMail
SET myMail = Server.CreateObject(&quot;CDONTS.Newmail&quot;)
myMail.MailFormat = 0
myMail.BodyFormat = 0
myMail.From = fromWho
myMail.To = toWho
myMail.Subject = Subject
myMail.Body = myContent
myMail.Send
SET myMail = Nothing
END SUB


fromWho = &quot;anyone@somewhere.com; someoneelse@anywhere.com&quot;
toWho = &quot;you@yourdomain.com&quot;
Subject = &quot;A new e-mail&quot;
myContent = &quot;A <B>new</B> e-mail has been sent from &quot; & TRIM(Request.Form(&quot;contact&quot;)) & &quot; of &quot; & TRIM(Request.Form(&quot;company&quot;)) & &quot;. <BR>Phone: &quot; & TRIM(Request.Form(&quot;phone&quot;)) & &quot;<BR>e-mail: &quot; & TRIM(Request.Form(&quot;email&quot;))


sendMail fromWho, toWho, Subject, myContent

Response.Redirect &quot;thanks2.asp&quot;
%>
 
you can also add

myMail.Bcc = &quot;you@yourdomain.com&quot;
and make
toWho = &quot;customer@theirdomain.com&quot; (or Request.Form(&quot;email&quot;) )

and it will send to you and customer simultaneously, with you being blindcopied.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top