a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Hosting from $3.99 per month!

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions. dd

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

HTML Email with ASPQmail and DRW

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> HTML Email with ASPQmail and DRW
Page: [1]
 
hessfirm

 

Posts: 153
Joined: 9/15/2004
Status: offline

 
HTML Email with ASPQmail and DRW - 12/12/2005 12:26:30   
I use ASPQmail to generate emails for site visitors. It works well. Below is script for anyone wishing to create HTML emails using ASPQmail and the DRW for database automation. (it also includes the ability to substitute text for html.) Thanks Spooky for your help.

<%

' ****************************************
' * DO NOT MODIFY THE FOLLOWING VALUES *
' * ServerObjects Inc. will NOT debug *
' * multi-part message problems! *
' * DO NOT MODIFY THE FOLLOWING VALUES *
' ****************************************
BOUNDARY = "----xxxxxx"
TEXT_HEADER = "--" & BOUNDARY & VBCrLf & "Content-Type: text/plain;" & VBCrLf & _
"Content-Transfer-Encoding: 7bit" & VBCrLf & VBCrLf
HTML_HEADER = "--" & BOUNDARY & VBCrLf & "Content-Type: text/html;" & VBCrLf & _
"Content-Transfer-Encoding: 7bit" & VBCrLf & VBCrLf
MP_FOOTER = "--" & BOUNDARY & "--" & VBCrLf


' ******************************************************
' * Set strTextBody to your message in plain text format
' ******************************************************
strTextBody = "Here's the information you requested in text format..." & VBCrLf & _
"Cordially," & VBCrLf & "The Management"

' ******************************************************
' * Set strHTMLBody to your message in HTML format
' ******************************************************
strHTMLBody = "<html><head><title>The Information You Requested</title></head>" & _
"<body bgcolor=""Black"" text=""Yellow"" link=""#0000FF"" vlink=""#800080"">" & _
"<img src="""&FP_FieldVal(fp_rs,"flyer")&""">" & _
"</body></html>"


' ****************************************
' * alternatively, above, if you want to use an actual image instead of the DRW, it would be "<img src=""http://www.mysite.com/images/myimage.jpg"">" & _ *
' ****************************************


' ****************************************
' * DO NOT MODIFY THE FOLLOWING VALUE *
' ****************************************
strBody = TEXT_HEADER & strTextBody & VBCrLf & HTML_HEADER & strHTMLBody & VBCrLf & MP_FOOTER


' ****************************************
' * Code your Mailer Object creation and
' * setup here
' ****************************************
Set Mailer = Server.CreateObject ("smtpsvg.mailer")
Mailer.QMessage = "true"
Mailer.RemoteHost = "your mail server or smtp address goes within these quotes (for example: ns3.myhost.net)"
Mailer.AddRecipient "Someone", ""&FP_FieldVal(fp_rs,"email")&""
Mailer.FromName = "Your Company Name"
Mailer.FromAddress = "bob@emailaddress.com"
Mailer.Subject = "MultiPart Message"

' ****************************************
' * DO NOT MODIFY THE FOLLOWING VALUES *
' ****************************************
Mailer.ContentType = "multipart/alternative; boundary=""" & BOUNDARY & """"
Mailer.BodyText = strBody


' ****************************************
' * Send the message
' * Code your testing for the success of
' * SendMail here
' ****************************************
if Mailer.SendMail then
Response.Write ("<br>Mail sent OK")
else
Response.Write ("<br>Mail failed. Error was " & Mailer.Response)
end if

Set Mailer = Nothing

%>



_____________________________

Steve Hess
Page:   [1]
OutFront Discoveries

All Forums >> Web Development >> ASP and Database >> HTML Email with ASPQmail and DRW
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts