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]	
Const ConnectNormal = 0
Const ConnectSSLAuto = 1
Const ConnectSTARTTLS = 2
Const ConnectDirectSSL = 3
Const ConnectTryTLS = 4

Private Sub SendEmail()
  Dim oSmtp As EASendMailObjLib.Mail
  Set oSmtp = New EASendMailObjLib.Mail
  ' for evaluation usage, please use "TryIt" as the license code.
  oSmtp.LicenseCode = "TryIt"
  
  ' Your SMTP server address
  oSmtp.ServerAddr = "smtp.emailarchitect.net"

  ' User and password for ESMTP authentication
  oSmtp.UserName = "test@emailarchitect.net"
  oSmtp.Password = "test"

  ' ConnectTryTLS means if server supports SSL/TLS connection, SSL/TLS is used automatically
  oSmtp.ConnectType = ConnectTryTLS

  oSmtp.ComputerName = "LocalIP"

  oSmtp.FromAddr = "test@adminsystem.net"
  oSmtp.AddRecipient "Support Team", "support@adminsystem.net", 0
  
  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 <tchar.h> #include <Windows.h> #include "EASendMailObj.tlh" using namespace EASendMailObjLib; const int ConnectNormal = 0; const int ConnectSSLAuto = 1; const int ConnectSTARTTLS = 2; const int ConnectDirectSSL = 3; const int ConnectTryTLS = 4; void SendEmail() { ::CoInitialize(NULL); IMailPtr oSmtp = NULL; oSmtp.CreateInstance(__uuidof(EASendMailObjLib::Mail)); oSmtp->LicenseCode = _T("TryIt"); // Your SMTP server address oSmtp->ServerAddr = _T("smtp.emailarchitect.net"); // User and password for ESMTP authentication, oSmtp->UserName = _T("test@emailarchitect.net"); oSmtp->Password = _T("testpassword"); // ConnectTryTLS means if server supports SSL/TLS connection, SSL/TLS is used automatically oSmtp->ConnectType = ConnectTryTLS; oSmtp->ComputerName = _T("mycomputerdomain.com"); oSmtp->FromAddr = _T("test@emailarchitect.net"); oSmtp->AddRecipient(_T("Support Team"), _T("support@adminsystem.net"), 0); if(oSmtp->SendMail() == 0) { _tprintf(_T("email was sent successfully!\r\n")); } else { _tprintf(_T("failed to send email with the following error: %s\r\n"), (const TCHAR*)oSmtp->GetLastErrDescription()); } }