|
Download ActiveEmail SMTP/POP3 Toolkit 3.1  (5024 KB - .exe file)
Download Manual  (192 KB - .htm file)
Using ActiveEmail SMTP/POP3 Toolkit with Microsoft Visual C# .NET
ActiveEmail SMTP/POP3 Toolkit is a software development kit (SDK) that enables the user to send (SMTP) and receive (POP3) e-mail messages.
ActiveEmail supports SMTP, POP3, multiple recipients (To, CC, BCC), multiple attachments (ASCII and binary),
rich text body formats (RTF/HTML), Unicode, multiple character sets, SMTP authorization (AUTH PLAIN, AUTH LOGIN, AUTH CRAM MD5),
POP3 authorization (Plain, APOP), POP3 header download, different character sets (including arabic, chinese, japanese, russian, greek and many more),
different encodings (including 7/8 bit, quoted-printable, base64).
ActiveEmail can be well integrated into Microsoft Visual Studio .NET environments.
This document describes how ActiveEmail can be integrated into Microsoft Visual C# .NET projects.
Step 1: Download and install ActiveEmail
Download the ActiveEmail SMTP/POP3 Toolkit from the ActiveXperts Download Site and start the installation.
The installation guides you through the installation process.
Step 2: Create a new Visual C# .NET Project
Launch Microsoft Visual Studio (for instance 'Microsoft Visual Studio 2005') from the Start menu.
Choose 'New' from the 'File' menu and click on 'Project'. In the 'New Project' dialog, select a Visual Studio template (for instance: 'Console Application').
Select a name for the application (for instance: 'DemoApp') and a name for the solution (for instance: 'DemoSolution'). Also, select the directory where you want to store the project (for instance: 'C:\MyProjects):

(Click on the picture to enlarge)
Step 3: Refer to the ActiveEmail Library and create the objects
Now that a new project has been created, you must add a reference to ActiveEmail in the project to be able to use the ActiveEmail objects.
To do so, choose 'Add Reference...' from the 'Project' menu.
In the 'Add Reference' dialog that pops up, select the 'COM' tab and select the 'ActiveEmail 3.0 Type Library' as shown in the following picture:

(Click on the picture to enlarge)
Click 'OK' to close the 'Add Reference' dialog.
On top of your code, type the following line to use the ActiveEmail namespace:
using AEMAILLib;
In your Main function, declare and create the following objects for SMTP:
SmtpServer objSmtpServer = new SmtpServer();
SmtpMail objSmtpServer = new SmtpMail();
To use POP3, declare and create the following objects:
SmtpServer objPop3Server = new Pop3Server();
Pop3Mail objPop3Mail; // NOTE: do NOT create the Pop3Mail object, because it is created by the
// Pop3Server object when a new message is received
To make use of ActiveEmail's constants, declare the EmailConstants object:
EmailConstants objConstants = new EmailConstants ()
Step 4: Send and/or receive an e-mail messages
You can now send and/or receive e-mail messages.
The following code shows how to send an e-mail message:
using System;
using AEMAILLib;
namespace AEmailDemo
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
SmtpMail objSmtpMail = new SmtpMail();
SmtpServer objSmtpServer = new SmtpServer();
EmailConstants objConstants = new EmailConstants();
objSmtpServer.Connect("smtp.myserver.com", "", "" );
Console.WriteLine("Connect, result: " + objSmtpServer.LastError ;
if(objSmtpServer.LastError == 0 )
{
objSmtpMail.FromAddress = "myname@mycompany.com";
objSmtpMail.FromName = "My Name";
objSmtpMail.AddTo("roger@thecompany.com", "My friend Roger");
objSmtpMail.Encoding = objConstants.asMESSAGE_ENCODING_DEFAULT;
objSmtpMail.BodyType = objConstants.asMESSAGE_BODY_PLAIN;
objSmtpMail.Priority = objConstants.asMESSAGE_PRIORITY_MEDIUM;
objSmtpMail.Subject = "Sample 01";
objSmtpMail.Body = "Hello my friend,\nHow are you doing\nRegards.";
object obj = objSmtpMail;
objSmtpServer.Send (ref obj );
Console.WriteLine("Send, result: " + objSmtpServer.LastError;
objSmtpServer.Disconnect();
Console.WriteLine("Disconnect (always successfull)");
}
}
}
}
There are many working samples included with the product.
You can also find them on the ActiveXperts FTP site: ftp.activexperts-labs.com/samples/activemail.
NOTE: Demo Projects are created with Microsoft Visual Studio 2002
The ActiveEmail project ships with a set of Microsoft Visual Studio .NET samples, including samples for Microsoft Visual C# .NET.
The projects are created with Microsoft Visual Studio 2002.
Users with a later version of Microsoft Visual Studio can open such a project. The Visual Studio Conversion Wizard will guide you through the process of converting the project to the version used.
ActiveEmail is a SMTP- and POP3 development component (SDK). This control can be used by any Windows development platform,
including Visual Basic .NET, Visual CSharp .NET,
ASP .NET (VB,CS),
ASP,
Visual Basic,
Visual Studio/Visual C++,
Delphi,
PHP,
HTML,
VBScript and any other ActiveX/COM compliant platform. ActiveEmail is an ActiveXperts Software B.V. Product.
|
|