ASP Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++DelphiFoxProJavaPerlPythonRubySQL ServerVBScript

ASP Examples

ASP String
ASP Byte Array
Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
S/MIME
Socket
Spider
RSA Encryption
Tar
Upload
XML
XMP
Zip Compression

More Examples...
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor

Unreleased...
Service
PPMD
Deflate
Bzip2
LZW
Bz2
DH Key Exchange
DSA
Icon

 

 

 

 

 

 

ASP Script to Send HTML Email

Download Chilkat Email ActiveX for ASP and Applications

More ASP POP3 Examples

More ASP SMTP Examples

More ASP Email Examples

ASP script showing how to send HTML email.

See Also:ASP Plain-Text Email

<%@ LANGUAGE="VBSCRIPT" %>
<HTML>
<HEAD>
<TITLE>Mail HTML with Embedded Image Example</TITLE>
</HEAD>
<BODY>

<%
	' Create a mailman
	set mailman = Server.CreateObject("Chilkat.MailMan2")

	' Any string begins the 30-day trial
	success = mailman.UnlockComponent("30-day trial")
	if (success = 0) then
		Response.write "Unlock Failed!<br>"
	end if
	
	' Tell the mailman where the SMTP server is located
	mailman.SmtpHost = "mail.earthlink.net"

	' Create an Email message
	set email = Server.CreateObject("Chilkat.Email2")

	' Enter the recipient's information
	email.AddTo "John Smith", "jsmith@chilkatsoft.com"

	' Enter the sender's information
	email.FromName = "Joe Smith"
	email.FromAddress = "joe.smith@somedomain.com"

	' Enter the email subject
	email.Subject = "Here is an image in HTML"

	' Modify this to point to your GIF image file.
	imageContentID = email.AddRelatedFile("c:\temp\dudeMail.gif")

	' Enter the email text
	email.SetHtmlBody ("<HTML><HEAD></HEAD><BODY>"& _
"<br>This is an example of embedding an image in HTML email.<BR><IMG SRC="& _
chr(34)&"cid:"&imageContentID&chr(34)& _
"><br>The content ID of the image looks like this: "& _
imageContentID&"<br>The HTML for embedding the image looks like this: <img src="& _
chr(34)&"cid:"&imageContentID&chr(34)&"><br></BODY></HTML>")

	' Send Email from ASP
	if mailman.SendEmail(email) then
		Response.write mailman.LastErrorHtml
		Response.write "Message sent successfully!<br><br>"
	else
		Response.write mailman.LastErrorHtml
	end if

	Set email = Nothing
	Set mailman = Nothing

%>



</BODY>
</HTML>



Relevant keywords: ASP Tutorial, ASP Script, ASP Application, ASP Software, ASP Code, ASP Programming, ASP Component, Free ASP Script, ASP Email, ASP Help, ASP Example, ASP Source Code, ASP Developer, ASP Mail, ASP XML, ASP Sample

 

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2008 Chilkat Software, Inc. All Rights Reserved.