ComputerName Property


Domain name to send in HELO/EHLO command

Data Type: String

Remarks

In HELO/EHLO SMTP command, a domain name is required to identify your current computer. The default value is your current machine name. You can change this value by ComputerName property.

If you use FastSender object to send email, please refer to ComputerName property of FastSender.

Example

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

		
[VB6]	
Private Sub SendEmail()
  Dim oSmtp As EASendMailObjLib.Mail
  Set oSmtp = New EASendMailObjLib.Mail
  
  'The license code for EASendMail ActiveX Object, 
  'for evaluation usage, please use "TryIt" as the license code.
  oSmtp.LicenseCode = "TryIt"
  
  oSmtp.ServerAddr = "mail.adminsystem.net"
  oSmtp.FromAddr = "test@adminsystem.net"
  oSmtp.AddRecipient "Support Team", "support@adminsystem.net", 0
 
  oSmtp.ComputerName = "LocalIP"
  
  oSmtp.BodyText = "Hello, this is a test...."
  If oSmtp.SendMail() = 0 Then
    MsgBox "Message delivered!"
  Else
    MsgBox oSmtp.GetLastErrDescription()
  End If
End Sub

[Visual C++]
#include "stdafx.h"
#include <comdef.h>
#include <iostream>
#include "easendmailobj.tlh"
using namespace EASendMailObjLib;
using namespace std;

void SendEmail()
{
  ::CoInitialize( NULL );
  IMailPtr oSmtp = NULL;
  oSmtp.CreateInstance(__uuidof(EASendMailObjLib::Mail));
 //The license code for EASendMail ActiveX Object, 
  //for evaluation usage, please use "TryIt" as the license code.
  oSmtp->LicenseCode = _bstr_t("TryIt");
  	
  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->ComputerName = _bstr_t("mycomputerdomain.com");

  
  oSmtp->BodyText = _bstr_t("Hello, this is a test....");
  if( oSmtp->SendMail() == 0 )
    cout << "Message delivered!" << endl;
  else
    cout << (const char*)(oSmtp->GetLastErrDescription()) << endl;
}