SMTP server address, it can be IP address or domain name. Multiple addresses can be divided with semicolon(;)
To achieve the best performance, it is recommended to install specified mail server(s) on the same local network as the SMTP object.
If ServerAddr property is not assigned, ANSMTP sends email via DNS lookup automatically. We recommend to use SetDnsServer method to specify DNS server on windows 95.
Click here to learn more detail about DNS lookup.
Usage Example:
[C#]
private void SendEmail()
{
AOSMTPLib.MailClass oSmtp = new AOSMTPLib.MailClass();
//You can specify multiple servers like this
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());
}
[JScript/WSH]
function SendEmail()
{
var oSmtp = new ActiveXObject("AOSMTP.Mail");
oSmtp.ServerAddr = "mail.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 )
WScript.Echo( "Message delivered!" );
else
WScript.Echo( oSmtp.GetLastErrDescription());
}
See Also
2001-2007 © Copyright AdminSystem Software Limited. All rights reserved.