|

DOWNLOAD
Reference
ASP 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-2012 Chilkat
Software, Inc. All rights reserved.
(Regarding the usage of the Android logo) Portions of this page are reproduced from work created and shared by Google
and used according to terms described in the Creative Commons
3.0 Attribution License.
Send feedback to support@chilkatsoft.com
Software components and libraries for Linux, MAC OS X, IOS (IPhone), Android™, Solaris, RHEL/CentOS Microsoft Windows 7, Vista, XP, 2000, 2003 Server, 2008 Server, and Windows 95/98/NT4.
|
|