Wednesday, 28 May 2008

Persits ASPEmail: Email using an external Templates

<%
dim strTextBody
dim objMail
set objMail = Server.CreateObject("Persits.MailSender")
objMail.Host = "your mailhost"
objMail.From = "your_email@a.com"
objMail.AddAddress = "your_email@a.com"
objMail.Subject = "career fair"
objMail.IsHTML = True
' Add embedded image for logo
objMail.AddEmbeddedImage Server.MapPath(".") & "\banner.jpg", "_Banner"
objMail.AddEmbeddedImage Server.MapPath(".") & "\footer.gif", "_Footer"
' append body from file
objMail.AppendBodyFromFile Server.MapPath(".") & "\BODY.htm"
objMail.AltBody = strTextBody
objMail.Send

set objMail = nothing
%>

In your HTML file place the following code:

<HTML>
<HEAD>
<TITLE>CAREER FAIR</TITLE>
<STYLE>
body{margin:0px;}
table.content{width:600px;}
td.content{background:#CCE5FF;font-family:verdana;font-size:11px;padding-top:20px;padding-bottom:20px;padding-left:40px;padding-right:40px;}
</STYLE>
</HEAD>
<BODY>
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" CLASS="content">
<TR><TD><IMG SRC='cid:_BANNER'></TD></TR>
<TR><TD CLASS="content">
Hi
<P>Blah
<P>Kindest Regards
<BR><b>Blah</b>
<BR>Graduate Team
</TD></TR>
<TR><TD><IMG SRC='cid:_FOOTER'></TD></TR>
</TABLE>
</BODY>
</HTML>

No comments: