LogFileName Property


Log file to record all transactions between client and server.

Data Type: String

Remarks

Log file will be created if it does not exist; otherwise new content will be appended at the end of the file..

Example

[Visual Basic, Visual C++] To get the full samples of EASendMail, please refer to Samples section.

[VB6, VBA - Send Email and Generate Log File] 
Private Sub SendEmail()
  Dim oSmtp As EASendMailObjLib.Mail
  Set oSmtp = New EASendMailObjLib.Mail

  oSmtp.LicenseCode = "TryIt"
  
  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

[Visual C++ - Send Email and Generate Log File]
#include "stdafx.h"
#include <comdef.h>
#include <iostream>
#include <iostream>
#include "easendmailobj.tlh"
using namespace EASendMailObjLib;
using namespace std;

void SendEmail()
{
  ::CoInitialize( NULL );
  IMailPtr oSmtp = NULL;
  oSmtp.CreateInstance( __uuidof(EASendMailObjLib::Mail));
  oSmtp->LicenseCode = _T("TryIt");
	
  oSmtp->ServerAddr = _T( "mail.adminsystem.net" );
  oSmtp->FromAddr = _T( "test@adminsystem.net" );
  oSmtp->AddRecipient( _T("Support Team"), 
                          _T("support@adminsystem.net"), 0 );

  oSmtp->Subject = _T("Test");
  oSmtp->BodyText = _T("Hello, this is a test....");
  
  oSmtp->LogFileName = _T("c:\\smtp.log");
  if( oSmtp->SendMail() == 0 )
    cout << "Message delivered!" << endl;
  else
    cout << (const TCHAR*)(oSmtp->GetLastErrDescription()) << endl;
}