|
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> <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> <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 & " </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'>©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
|