![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
ASP Script to Send HTML Email
ASP script showing how to load a Web page and send it as HTML email. <%@ LANGUAGE="VBSCRIPT" %>
<HTML>
<HEAD>
<TITLE>Mail HTML with Embedded Image Example</TITLE>
</HEAD>
<BODY>
<%
' Create a mailman
set mht = Server.CreateObject("Chilkat_9_5_0.Mht")
set mailman = Server.CreateObject("Chilkat_9_5_0.MailMan")
' Unlock the component - any string automatically begins a 30-day trial.
mailman.UnlockComponent "30-day trial"
mht.UnlockComponent "30-day trial"
' Tell the mailman where the SMTP server is located
mailman.SmtpHost = "smtp.chilkatsoft.com"
' Create an Email message
set email = mht.GetEmail("http://www.bonairefishing.com/")
if (email is Nothing) then
Response.Write mht.LastErrorHtml
else
' 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 = "Bonaire Fishing"
' Send Email from ASP
if mailman.SendEmail(email) then
Response.write "Message sent successfully!"
else
Response.write mailman.LastErrorHtml
end if
end if
' Standard ASP cleanup of objects
Set email = Nothing
Set mailman = Nothing
%>
</BODY>
</HTML>
|
||||||||
© 2000-2026 Chilkat Software, Inc. All Rights Reserved.