Using XMLHTTP in Asp to send Template Emails
Many of us run websites, we do send newsletters, many people do like sending template emails to represent their company in a prestigeous way. Here is the way for beginners to know about how to send templated emails.Follow the below given steps to send professional templated emails.
Step1:
- Design you email. - Make it look elegant, pleasant and professional.
- Template should reflect your thoughts.
- Place content and relative pictures side by side, such that if the content explains 50% of what you are saying, the rest should be explained by the image that you place in th email.
- Place bullets and highlighted text to explain the objective of the email.
Once design is done,for example if you have design ed a html page, with the relative images in a images folder, the image path should be given such that, if your domain name is "yourdomain.com" then give the path for the images as "<img src='http://www.yourdomain.com/images/xyz.gif'>" instead of "<img src='images/xyz.gif'>"
Do not import style sheets, add all the styles in the heading tags of the page and upload the images with the HTML file to the server.
Step2:
Next step would be preparing an ASP page to send newsletter to your customers and friends.
Create a simple ASP page(newsletter.asp) and paste the below given content.
<!-- <%
if request("mode")="send" then
strFrom=request("textFrom")
strTo=request("textTo")
Set ObjXml = Server.CreateObject("Microsoft.XMLHTTP")
ObjXml.Open "GET", "http://www.yourdomain.com/html page name here", false
ObjXml.Send ""
RetString = ObjXml.responseText
Set objCDONTS = server.CreateObject("CDONTS.NewMail")
With objCDONTS
.From = strFrom
.To = strTo
.BodyFormat = 0
.MailFormat = 0
.Body = RetString
.Send
End With
Set objCDONTS = Nothing
end if
%>
<html>
<body>
<form name="thisForm" method="post" action="newsletter.asp">
<input type="hidden" name="mode" value="send">
From email address<input type="textFrom" maxlength="255"><br>
To email address<input type="textTo" maxlength="255"><br>
<input type="submit" name="btnSend" value="Send">
</form>
</body>
</html>
-->
You can download your copy and try yourself.
Click here to download Template_Email.zip (Size:553 bytes)

