Search The ForumSearch   RegisterRegister  LoginLogin

MailBee SMTP

 AfterLogic Forum : MailBee SMTP
Subject Topic: How to check for connectivity? Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Nishant
Newbie
Newbie
Avatar

Joined: 04 March 2009
Location: India
Online Status: Offline
Posts: 5
Posted: 04 March 2009 at 11:31pm | IP Logged Quote Nishant

I want to check for SMTP connectivity. How can I check it without sending any mail?
Back to Top View Nishant's Profile Search for other posts by Nishant
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 05 March 2009 at 1:07am | IP Logged Quote Igor

You can connect to SMTP server and disconnect from it without sending data as follows:

Code:
Dim Mailer
Set Mailer = CreateObject("MailBee.SMTP")
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
  MsgBox "Connected successfully"
  Mailer.Disconnect
Else
  ' Server not available, PLAIN is not supported or username/password is incorrect
  MsgBox Mailer.ErrDesc
End If


Regards,
Igor
Back to Top View Igor's Profile Search for other posts by Igor
 
Nishant
Newbie
Newbie
Avatar

Joined: 04 March 2009
Location: India
Online Status: Offline
Posts: 5
Posted: 05 March 2009 at 2:34am | IP Logged Quote Nishant

Thanks a lot. It worked fine. I am not using PLAIN. After commenting Mailer.AuthMethod = 1 line. I am getting "Connected successfully" in spite of providing wrong user name and password.
Back to Top View Nishant's Profile Search for other posts by Nishant
 
Nishant
Newbie
Newbie
Avatar

Joined: 04 March 2009
Location: India
Online Status: Offline
Posts: 5
Posted: 05 March 2009 at 2:46am | IP Logged Quote Nishant

I got it. If we need to test username and password also. we should use Mailer.AuthMethod = 2    
Back to Top View Nishant's Profile Search for other posts by Nishant
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide