Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component

  

  

  Chilkat ActiveX Components

  Chilkat .NET Components

  Chilkat C++ Libraries

  

  

  

  

 

FAQ

ASP Email Component

DOWNLOAD ReferenceASP Examples


Web Mail ASP Example

ASP Script to Send an Email Message

This example script demonstrates how to create an Email programmatically and send it.

<%@ LANGUAGE="VBSCRIPT" %>
<HTML>
<HEAD>
<TITLE>Chilkat WebMail Example: Send an Email message</TITLE>
</HEAD>
<BODY>

<%
	' Create a mailman.  The mailman can send and receive Emails.
	set mailman = Server.CreateObject("ChilkatWebMail.WebMailMan")

    ' Unlock the component - use your trial or purchased unlock code.
    mailman.UnlockComponent "unlock_code"

	' Tell the mail man where the SMTP server is located
	mailman.SmtpHost = "www.somedomain.com"

	' Create an empty Email message
	set email = Server.CreateObject("ChilkatWebMail.WebEmail")

	' Enter the recipient's information
	email.AddTo "Michael Johnson", "michael.johnson@somedomain.com"

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

	' Enter the email subject
	email.Subject = "Important News"

	' Enter the email text
	email.Body = "Hello Michael," & vbCrLf & vbCrLf & "Did you hear the news? ..."

	' Send the email
	if mailman.SendEmail(email) then
		Response.write "Message sent successfully!<br><br>"
	else
		Response.write "ERROR: Message not sent!<br><br>"
	end if
%>
    <br>(View page source to see the log)
    <XML ID="XMLID">
<%
    Response.write mailman.GetInstanceLog()
%>
    </XML>
<%

	' Remove our references.
	Set email = Nothing
	Set mailman = Nothing

    ' End of ASP Script to send Email.
%>

</BODY>
</HTML>

* This is an example ASP Script to Send an Email Message.

 


Privacy Statement. Copyright 2000-2010 Chilkat Software, Inc. All rights reserved.
Send feedback to support@chilkatsoft.com

Components for Microsoft Windows 7, Vista, XP, 2000, 2003 Server, and Windows 95/98/NT4.