Print Page | Close Window

Html Body Format

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=16846
Printed Date: 29 March 2026 at 7:01pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Html Body Format
Posted By: padoxky
Subject: Html Body Format
Date Posted: 08 October 2005 at 12:20pm
I want to send email that contains something like letterhead from my website. Is something like newsletters when i send to my subscriber it will go along with my formated table, logo and the text msg.
 
i did something like this:
 
 
strName = Replace(Request.Form("n"), "'", "''")
 strEmail = Replace(Request.Form("e2"), "'", "''")
 strEmailTo = trim(request.form("e2"))
 strTitle = trim(request.form("3"))
 strDetail = trim(request.form("1"))
 
 htmlBody = htmlBody & "<div align='center'>"
htmlBody = htmlBody & "<table border='0' width='67%' height='310' cellpadding='2' style='border-collapse: collapse; border: 1px solid #C7D2DC'>"
htmlBody = htmlBody & "<tr>"
htmlBody = htmlBody & "<td height='66' width='100%' valign='top'>"
htmlBody = htmlBody & "<div align='center'>"
htmlBody = htmlBody & "<table border=0 width=100% id=table2 cellspacing=0 cellpadding=0 height=64>"
htmlBody = htmlBody & "<tr>"
htmlBody = htmlBody & "<td width=61% valign=bottom>"
htmlBody = htmlBody & "<p align=center><a href='dir/default.asp'>"
htmlBody = htmlBody & "<img border=0 src='dir/dir_img/log.gif' width=299 height=55 alt='YellowPage Nigeria Online Directories'></a></td>"
htmlBody = htmlBody & "<td width='39%'>"
htmlBody = htmlBody & "<p align='center'><b><font size='1' face='Verdana' color='#FF0000'>"
%> <%=formatDateTime(Date,1)%>
<%
htmlBody = htmlBody & "</font></b></td>"
htmlBody = htmlBody & "</tr>"
htmlBody = htmlBody & "</table>"
htmlBody = htmlBody & "</div>"
htmlBody = htmlBody & "</td></tr><tr>"
htmlBody = htmlBody & "<td height=10 width=493 style='border-top:1px solid #C7D2DC; border-left-width: 1px; border-right-width: 1px; border-bottom-width:1px' bgcolor=#E6FFF2 valign=bottom>"
htmlBody = htmlBody & "<font face=Verdana>&nbsp;<font style='font-size: 9pt'>"
htmlBody = htmlBody & "<font color=#0000FF>"
htmlBody = strName
htmlBody = htmlBody & "</font> sent you a Joke from Nigeria Online Directories</font></font></td>"
htmlBody = htmlBody & "</tr><tr>"
htmlBody = htmlBody & "<td height='29' width='493' style='border-top:1px solid #C7D2DC; border-left-width: 1px; border-right-width: 1px; border-bottom-width:1px' valign='top'>"
htmlBody = htmlBody & "<p align=center><b><font size=1 face=Verdana><br>"
htmlBody = htmlBody & "</font><font face=Verdana style='font-size: 9pt'>"
htmlBody = strTitle
htmlBody = htmlBody & "</font></b></td>"
htmlBody = htmlBody & "</tr><tr>"
htmlBody = htmlBody & "<td height='199' width='493' style='border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom: 1px dotted #C7D2DC' valign='top'><br>"
htmlBody = strDetail
htmlBody = htmlBody & "</td>"
htmlBody = htmlBody & "</tr><tr>"
htmlBody = htmlBody & "<td height=42 width=493 style='border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom: 1px dotted #C7D2DC' valign='top'><font size='1' face='Verdana'><br>More Jokes <a href='http://yellowpage.ngwebdesigns.net/dir/jokes.asp'>click here</a>&nbsp;&nbsp;&nbsp;&nbsp;<br>"
htmlBody = htmlBody & "For Online Directories, Advertisement, Business Contact, Jokes, Love Note and"
 htmlBody = htmlBody & "lot more. <br>Visit website <a href='http://www.yellowpage.ngwebdesigns.net'>"
htmlBody = htmlBody & "
http://www.yellowpage.ngwebdesigns.net .
For">http://www.yellowpage.ngwebdesigns.net</a>.<br>For website designs visit website"
htmlBody = htmlBody & "<a href='http://www.ngwebdesigns.net'>http://www.ngwebdesigns.net</a><br>"
htmlBody = htmlBody & "&nbsp;</font></td></tr><tr><td height='3' width='493' bgcolor='#008000'>"
htmlBody = htmlBody & "<div align='center'><table border='0' width='504' id='table1' cellspacing='0'>"
htmlBody = htmlBody & "<tr><td width='330' bgcolor='#FFFF00'>"
htmlBody = htmlBody & "<p align='center'><font size='1' face='Verdana'>&copy;2005, YellowPage</font></td>"
htmlBody = htmlBody & "<td width='170' bgcolor='#FFFF00'><p align='right'><b><font size='1' face='Verdana'>"
htmlBody = htmlBody & "<a target='_blank' href='http://www.ngwebdesigns.net'>"
htmlBody = htmlBody & "<span style='text-decoration: none'><font color='#000000'>powered by NgWebDeisgns</font></span></a></font></b></td></tr></ta ble></div></td></tr></table></div>"
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
 Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
objCDOSYSCon.Fields(" http://schemas.microsoft.com/cdo/configuration/smtpserver - http://schemas.microsoft.com/cdo/configuration/smtpserver ") = "mail.yourdomain.com"
objCDOSYSCon.Fields("
http://schemas.microsoft.com/cdo/configuration/sendusername - http://schemas.microsoft.com/cdo/configuration/sendusername ") = mailto:you@yourdomain.com - you@yourdomain.com
objCDOSYSCon.Fields(" http://schemas.microsoft.com/cdo/configuration/sendpassword - http://schemas.microsoft.com/cdo/configuration/sendpassword ") = "pass"
    objCDOSYSCon.Fields("
http://schemas.microsoft.com/cdo/configuration/smtpauthenticate - http://schemas.microsoft.com/cdo/configuration/smtpauthenticate ") = 1
  objCDOSYSCon.Fields(" http://schemas.microsoft.com/cdo/configuration/smtpserverport - http://schemas.microsoft.com/cdo/configuration/smtpserverport ")  = 25
  objCDOSYSCon.Fields("
http://schemas.microsoft.com/cdo/configuration/sendusing - http://schemas.microsoft.com/cdo/configuration/sendusing ") = 2
  objCDOSYSCon.Fields("
http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout - http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout ") = 60
  objCDOSYSCon.Fields.Update
  Set objCDOSYSMail.Configuration = objCDOSYSCon
  objCDOSYSMail.From = strEmail
  objCDOSYSMail.To = strEmailTo
  objCDOSYSMail.Subject = strName & "[Send you a Joke]"
  objCDOSYSMail.HTMLBody = htmlBody
    
  objCDOSYSMail.Send
  Set objCDOSYSMail = Nothing
  Set objCDOSYSCon = Nothing
Response.redirect "page.htm"
end if
 
 

-------------
NgWebDesigns



Replies:
Posted By: dpyers
Date Posted: 08 October 2005 at 9:05pm
First make sure your email client doesn't have html turned off.

Many email clients are stricter about valid html than browsers are. You your htm needs to start and end with html, head, and body tags.

BTW... I think you misspelled NgWebDesigns as NgWebDeisgns Wink

-------------

Lead me not into temptation... I know the short cut, follow me.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net