Log file to record all transactions between client and server.
Log file will be created if it does not exist; otherwise new content will be appended at the end of the file..
Usage Example:
[Visual Basic]
Private Sub SendEmail()
Dim oSmtp As ANSMTPLib.OBJ
Set oSmtp = New ANSMTPLib.OBJ
oSmtp.ServerAddr = "mail.adminsystem.net"
oSmtp.FromAddr = "test@adminsystem.net"
oSmtp.AddRecipient "Support Team", "support@adminsystem.net", 0
oSmtp.Subject = "Test"
oSmtp.BodyText = "Hello, this is a test...."
oSmtp.LogFileName = "c:\smtp.log"
If oSmtp.SendMail() = 0 Then
MsgBox "Message delivered!"
Else
MsgBox oSmtp.GetLastErrDescription()
End If
End Sub
[C#]
private void SendEmail()
{
OBJClass oSmtp = new OBJClass();
oSmtp.ServerAddr = "mail.adminsystem.net";
oSmtp.FromAddr = "test@adminsystem.net";
oSmtp.AddRecipient( "Support Team", "support@adminsystem.net", 0 );
oSmtp.BodyFormat = 1; //html email body
oSmtp.Subject = "Test";
oSmtp.BodyText = "Hello, this is a test....";
oSmtp.LogFileName = "c:\\smtp.log"
if( oSmtp.SendMail() == 0 )
Console.WriteLine( "Message delivered!" );
else
Console.WriteLine( oSmtp.GetLastErrDescription());
}
[Visual C++]
#include "stdafx.h"
#include <comdef.h>
#include <iostream>
#import "C:\Program Files\AdminSystem.NET\ANSMTP\ANSMTP.dll" \
rename_namespace("ANSMTPLib")
using namespace ANSMTPLib;
using namespace std;
void SendEmail()
{
::CoInitialize( NULL );
IOBJPtr oSmtp = NULL;
oSmtp.CreateInstance("ANSMTP.OBJ");
oSmtp->ServerAddr = _bstr_t( "mail.adminsystem.net" );
oSmtp->FromAddr = _bstr_t( "test@adminsystem.net" );
oSmtp->AddRecipient( _bstr_t("Support Team"),
_bstr_t("support@adminsystem.net"), 0 );
oSmtp->Subject = _bstr_t("Test");
oSmtp->BodyText = _bstr_t("Hello, this is a test....");
oSmtp->LogFileName = _bstr_t("c:\\smtp.log");
if( oSmtp->SendMail() == 0 )
cout << "Message delivered!" << endl;
else
cout << (const char*)(oSmtp->GetLastErrDescription()) << endl;
}
2001-2007 © Copyright AdminSystem Software Limited. All rights reserved.