|

DOWNLOAD
Reference
ASP Examples
Visual Basic Examples
Chilkat Mail Example:
Send an Email
This example demonstrates how to create an Email
programmatically and send it.
IMPORTANT: If Chilkat Mail
and Chilkat WebMail are separate components.
If you are using Chlilkat WebMail, the code is the same, but the
names of the components created are different. Use CreateObject("ChilkatWebMail.WebMailMan")
instead.
<%@ LANGUAGE="VBSCRIPT" %>
<HTML>
<HEAD>
<TITLE>Chilkat Mail Example: Send an Email</TITLE>
</HEAD>
<BODY>
<%
' Create a mailman. The mailman can send and receive Emails.
set mailman = Server.CreateObject("ChilkatMail.ChilkatMailMan")
' Get the UnlockCode free from http://www.chilkatsoft.com
mailman.UnlockComponent "unlock-code"
' Tell the mailman where the SMTP server is located
mailman.SmtpHost = "www.somedomain.com"
' Create an empty Email message
set email = Server.CreateObject("ChilkatMail.ChilkatEmail")
' 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
' Remove our references.
Set email = Nothing
Set mailman = Nothing
%>
</BODY>
</HTML>
|
|
Privacy
Statement. Copyright 2000-2008 Chilkat
Software, Inc. All rights reserved.
Send feedback to support@chilkatsoft.com Components for Microsoft Windows XP, 2000, 2003 Server, Vista, and Windows 95/98/NT4.
|
|