programming-examples/asp/More_Code_Snippets/How to send an HTML formatted e-mail.asp

25 lines
844 B
Plaintext
Raw Permalink Normal View History

2019-11-18 14:25:58 +01:00
<%
Dim objCdonts , strHTML
Set objCdonts = Server.CreateObject("CDONTS.NewMail")
'now we will produce the basis of our email
strHTML = strHTML & "<html><head><title>sample html email</title></head>"
strHTML = strHTML & "<body>"
strHTML = strHTML & "<p>some text to display</p>"
strHTML = strHTML & "<br><hr>"
strHTML = strHTML & "<a href=""asp.programmershelp.co.uk"">asp site</a>"
strHTML = strHTML & "</body></html>"
'your address
objCdonts.From ="youraddress@email.com"
'recipients address
objCdonts.To = "someones@email.com"
'what is the email about
objCdonts.Subject ="an HTML email example"
'these next lines are vital for HTML formatted mail
objCdonts.BodyFormat = 0
objCdonts.MailFormat = 0
'your message
objCdonts.Body = strHTML
'send that email
objCdonts.Send
Set objCdonts = Nothing
%>