|
|
||||
|
ANSMTP smtp component provides an easy way to enable your ASP, VB, VBA, VC++, C#, VB.NET, JScript.NET, ASP.NET or other COM environment applications to send rich TEXT/HTML email based on SMTP or ESMTP protocol. It also can lookup DNS MX record to send email without specified SMTP server. ANSMTP Object is a high performance SMTP COM Object which supports CC, BCC, multiple attachments and ESMTP authentication. It fully supports asynchronous operating mode and event driving. It also provides advanced features such as embedded picture, anonymous email, alternative text and customized header. Important notice:* This product has integrated to EASendMail SMTP Component, Please use EASendMail SMTP Component instead of ANSMTP SMTP Component.
Related Links:
ANSMTP consists of two objects: IMail and IFastSender. Mail object provides the basis of sending email. It supports CC, BCC, multiple attachments and ESMTP authentication. It fully supports asynchronous operating mode and event driving. It also provides advanced features such as embedded picture and alternative text. FastSender object enables your application to send mass email in a threadings-pool with highest performance. |
|
Quick Tutorial - ASP/VB/VC++/C#/JScript/ASP.NET With only some simple scripts your applications will be enabled to create and send Rich Text/Html emails. |
|
ASP Sample
'This sample demonstrates how to send email in ASP
<%
Set SMTP = Server.CreateObject("AOSMTP.Mail")'create com object
'If you don't specify a smtp server,
'ansmtp smtp component would simulate a smtp server to send email automatically
SMTP.ServerAddr = "control.component.com" 'email server
SMTP.FromAddr = "John@component.com" 'sender's email address
SMTP.AddRecipient "Dennis", "Dennis@component.com", 0 'add an email recipient
SMTP.BodyFormat = 1 'html format
SMTP.Subject = "send email in asp and vbscript" 'email subject
SMTP.BodyText ="<html>...." 'email body
If SMTP.SendMail() = 0 Then 'send email
Response.write "Email delivered"
Else
Response.write SMTP.GetLastErrDescription
End If
%>
|
|
Visual Basic Sample
'This sample demonstrates how to send email in Visual Basic
Dim SMTP As Object
Set SMTP = CreateObject("AOSMTP.Mail") 'create com object
'If you don't specify a smtp server,
'ansmtp smtp component would simulate a smtp server to send email automatically
SMTP.ServerAddr = "smtp.component.com" 'email server
SMTP.FromAddr = "Asp@component.com" 'sender' email address
SMTP.AddRecipient "Dennis", "Dennis@component.com", 0 'add an email recipient
SMTP.BodyFormat = 1 'html format
SMTP.Subject = "send email in Visual Basic" 'email subject
SMTP.BodyText ="<html>...." 'email body
If SMTP.SendMail() = 0 Then 'send email
MsgBox "Email delivered", vbOKOnly, "ANSMTP COM Object"
Else
MsgBox SMTP.GetLastErrDescription, vbOKOnly, "ANSMTP COM Object"
End If
|
|
Visual C++ Sample //This sample domenstrates how to send email in Visual C++ #include <comdef.h> #include "AOSMTP.h" #include "AOSMTP_i.c" HRESULT hr = ::CoInitialize( NULL ); long lRet = 0; IMail* SMTP = NULL; |
|
CSharp Sample
//This sample demonstrates how to send email in CSharp
using System;
using AOSMTPLib;
namespace CSharpSample
{
class SendEmail
{
public static void Main( string[] args )
{
AOSMTPLib.MailClass SMTP = new AOSMTPLib.MailClass(); //create component instance
//If you don't specify the value of ServerAddr property,
//ANSMTP would simulate a smtp server to send email automatically.
SMTP.ServerAddr = "smtp.component.com"; //email server
SMTP.FromAddr = "Asp@component.com"; //sender' email address
SMTP.AddRecipient( "Dennis", "Dennis@component.com", 0 ); //normal recipient
SMTP.BodyFormat = 1; //html format
SMTP.Subject = "send email asp asp.net, smtp, control, dotnet"; //email subject
SMTP.BodyText ="<html>.... ocx, library, activex, component, NET assemble";//body
if( SMTP.SendMail() == 0 )//send email
Console.WriteLine( "Email delivered" );
else
Console.WriteLine( SMTP.GetLastErrDescription() );
}
}
}
|
|
ASP.NET Sample
//This sample demonstrates how to send email in CSharp and ASP.NET
<%@ Page language="c#" AutoEventWireup="false" aspcompat=true%>
<%@ Import Namespace="AOSMTPLib"%>
<script language="c#" runat="server">
private void Page_Load( object sender , System.EventArgs e)
{
AOSMTPLib.MailClass m_SMTP = (AOSMTPLib.MailClass)Server.CreateObject("AOSMTP.Mail");
m_SMTP.Reset();
//if you don't specify a smtp server,
//ansmtp smtp component would simulate a smtp server to send email automatically.
m_SMTP.ServerAddr = "asp.email.com;//smtp server address
m_SMTP.FromAddr = "asp@adminsystem.net";//sender's email address
m_SMTP.Subject = "send email in asp.net with ansmtp smtp component"; //email subject
m_SMTP.BodyText = "sample code for sending email in c# and asp.net";//email body
m_SMTP.AddRecipient( "dennis", "dennis@msn.com", 0 ); //add an email recipient
if( m_SMTP.SendMail() != 0 )
Response.Write( m_SMTP.GetLastErrDescription());
else
Response.Write( "Sent email successfully" );
//you can also send email via pickup path of IIS or Exchange SMTP Service
//that is very high performance and all emails are sent in background.
//If you installed MS Exchange server on your server, pickup directory will be
//changed to c:\Program Files\Exchsrvr\Mailroot\vsi 1\PickUp
//string strPickupPath = "C:\\Inetpub\\mailroot\\Pickup";
//if( m_SMTP.SaveMailEx( strPickupPath ) == 0 )
// Response.Write( "Sent email to queue successfully" );
}
</script>
|
|
JScript Sample
//This sample demonstrates how to send email in JScript
var smtp = new ActiveXObject("AOSMTP.Mail"); //create smtp component instance
//if you don't specify a smtp server,
//ansmtp smtp component would simulate a smtp server to send email automatically.
smtp.ServerAddr = "smtp.email.com";
smtp.FromAddr = "asp.email.com"; //sender's email address
smtp.Subject = "send email in JScript"; //email subject
smtp.BodyText = "sample code for ansmtp smtp component"; //email body
smtp.AddRecipient( "dennis", "dennis@msn.com", 0 ); //add an email recipient
if( m_SMTP.SendMail() != 0 )
WScript.Echo( m_SMTP.GetLastErrDescription());
else
WScript.Echo( "Sent email successfully" );
|
|
Learn more information about ANSMTP SMTP COMOPONENT
Email: support@emailarchitect.net |
|