Connect Method
Connects to the SMTP server, sends hello and optionally authenticates the client.
Make sure to set at least the following properties before calling this method:
blnResult = ObjectName.Connect |
Parameters: | None | |
Return value As Boolean | True if successful, False if connect procedure failed (mail server is not responding, username and/or password is incorrect, authentication method is not supported, license key is invalid). You may check ErrDesc property or log file to get more detailed error information |
Usage example:
Dim Mailer 'Using visual basic to create object Set Mailer = CreateObject("MailBee.SMTP") 'Using ASP to create object 'Set Mailer = Server.CreateObject("MailBee.SMTP") 'In ASP use Response.Write instead of MsgBox Mailer.LicenseKey = "put your license key here" Mailer.ServerName = "mail.server.com" Mailer.UserName = "MyName" Mailer.Password = "MyPassword" Mailer.AuthMethod = 1 ' PLAIN ESMTP authentication If Mailer.Connect Then Mailer.Message.ToAddr = "bill@yoursite.com" Mailer.Message.FromAddr = "joe@mysite.com" Mailer.Message.Subject = "Hello" Mailer.Message.ImportBodyText "C:\docs\letter.htm", True Mailer.Send Mailer.Disconnect Else ' Server not available, PLAIN is not supported or username/password is incorrect MsgBox Mailer.ErrDesc End If
See Also:
ServerName
Property
Domain Property
Message.FromAddr Property
PortNumber Property
UserName Property
Password Property
AuthMethod Property
Disconnect Method
Copyright © 2002-2024, AfterLogic Corporation. All rights reserved.