ASP Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL 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
ASP Upload
XML
XMP
Zip Compression

More Examples...
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
SSH Key
SSH
SSH Tunnel
SFTP

Unreleased...
Bzip2
LZW
Bz2
Icon

 

 

 

 

 

 

Convert Email HTML to Plain-Text Alternative

Loads an HTML email from a web page, converts the HTML to a plain-text alternative body, and sends it.

Download Chilkat Email ActiveX

Download Chilkat HTML-to-XML ActiveX (also includes HTML-to-PlainText conversion)

Download Chilkat MHT ActiveX

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
'  The mailman object is used for receiving (POP3)
'  and sending (SMTP) email.
set mailman = Server.CreateObject("Chilkat.MailMan2")

'  The MHT component can be used to convert an HTML page
'  from a URL, file, or in-memory HTML into an email
'  with embedded images and style sheets.
set mht = Server.CreateObject("Chilkat.Mht")

'  Any string argument automatically begins the 30-day trial.
success = mailman.UnlockComponent("30-day trial")
If (success <> 1) Then
    Response.Write "MailMan component unlock failed" & "<br>"

End If

success = mht.UnlockComponent("30-day trial")
If (success <> 1) Then
    Response.Write "Mht component unlock failed" & "<br>"

End If

mht.UseCids = 1
Set email = mht.GetEmail("http://www.bonairefishing.com/")
If (email Is Nothing ) Then
    Response.Write mht.LastErrorText & "<br>"

End If

email.Subject = "Test HTML/plain-text email"

email.AddTo "Chilkat Support","support@chilkatsoft.com"
email.From = "admin@chilkatsoft.com"

set h2t = Server.CreateObject("Chilkat.HtmlToText")
success = h2t.UnlockComponent("Anything for 30-day trial")
If (success <> 1) Then
    Response.Write h2t.LastErrorText & "<br>"

End If

'  Get the email's HTML body.

html = email.GetHtmlBody()

'  Convert it to plain text:

plainText = h2t.ToText(html)

'  Add a plain-text alternative to the email:
email.AddPlainTextAlternativeBody plainText

mailman.SmtpHost = "mail.chilkatsoft.com"
mailman.SmtpUsername = "admin@chilkatsoft.com"
mailman.SmtpPassword = "*myPassword5*"

success = mailman.SendEmail(email)
If (success <> 1) Then
    Response.Write mailman.LastErrorText & "<br>"

End If

Response.Write "HTML/plain-text Email Sent!" & "<br>"


%>
</body>
</html>

 

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

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