LocalIP Property

Specify the IP address of local computer to connect server.


Data Type: String


Remarks

Usually, ANSMTP automatically chooses one of local IP addresses to connect remote server. But if you want to bind a specified IP address to current connection, you can use this property.

Usage Example:

[C#]
private void SendEmail()
{
  AOSMTPLib.MailClass oSmtp = new AOSMTPLib.MailClass();
  oSmtp.LocalIP = "192.168.0.1";
  oSmtp.ServerAddr = "mail.adminsystem.net;mx.adminsystem.net";
  //If you don't have SMTP server, use the following code
  //send email via DNS lookup, ANSMTP lookups smtp server automatically.
  //oSmtp.ServerAddr = "";  
  
  oSmtp.FromAddr = "test@adminsystem.net";
  oSmtp.AddRecipient( "Support Team", "support@adminsystem.net", 0 );

  oSmtp.Subject = "Test";
  oSmtp.BodyText = "Hello, this is a test....";
  
  if( oSmtp.SendMail() == 0 )
    Console.WriteLine( "Message delivered!" );
  else
    Console.WriteLine( oSmtp.GetLastErrDescription());
}

2001-2007 © Copyright AdminSystem Software Limited. All rights reserved.