NEWS   PRODUCTS   DOWNLOADS   SUPPORT   CONTACT   DEVELOPERS    COMMUNITY

ANSMTP SMTP COMPONENT BUILD 6.5

Platform: Windows95/98/2000/NT/ME/XP/2003

Buy   Download   Detail

ANSMTP V6.5 Release
October, 2005

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:* For C#, Visual Basic.NET, Managed C++, J#, JScript.NET and ASP.NET developers, please use the pure .NET class EASendMail SMTP Component.

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;
hr = ::CoCreateInstance( CLSID_Mail, NULL, CLSCTX_ALL, IID_IMail, (LPVOID*)&SMTP );//create ansmtp component object _ASSERT( SMTP != NULL ); //If you don't specify a smtp server, //ansmtp smtp component would simulate a smtp server to send email automatically SMTP->put_ServerAddr( _bstr_t("smtp.email.com") ); //email server SMTP->put_FromAddr( _bstr_t("John@email.com") ); //sender' email address SMTP->AddRecipient( _bstr_t("Dennis"), _bstr_t("Dennis@mail.com"), 0, &lRet ); //add an email recipient SMTP->put_BodyFormat( 1 ); //html format SMTP->put_Subject( _bstr_t("send email in Visual C++")); //email subject SMTP->put_BodyText( _bstr_t("<html>....") ); //email body SMTP->SendMail( &lRet ); //send email if( lRet == 0 ) printf( "Email delivered" ); else { BSTR bstrErr = NULL; SMTP->GetLastErrDescription(&bstrErr); printf( _bstr_t( bstrErr )); SysFreeString( bstrErr ); }

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

ANSMTP documentation/samples

Email: support@emailarchitect.net


2001-2005 ? Copyright AdminSystem Software Limited. All rights reserved.    About us   Links
1 2 10 3 4 5 6 7 11 8 1