| Author |  | 
      
        | Nishant Newbie
 
  
  
 Joined: 04 March 2009
 Location: India
 Online Status: Offline
 Posts: 5
 | 
          I want to check for SMTP connectivity. How can I check it without sending any mail?
           | Posted: 04 March 2009 at 11:31pm | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6167
 | 
          You can connect to SMTP server and disconnect from it without sending data as follows:
           | Posted: 05 March 2009 at 1:07am | IP Logged |   |  
           | 
 |  
 
 
| 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 |     | 
       
       
        |  | 
        | Nishant Newbie
 
  
  
 Joined: 04 March 2009
 Location: India
 Online Status: Offline
 Posts: 5
 | 
          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.
           | Posted: 05 March 2009 at 2:34am | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Nishant Newbie
 
  
  
 Joined: 04 March 2009
 Location: India
 Online Status: Offline
 Posts: 5
 | 
          I got it. If we need to test username and password also. we should use Mailer.AuthMethod = 2
           | Posted: 05 March 2009 at 2:46am | IP Logged |   |  
           | 
 |    | 
       
        | Back to Top |     | 
       
       
        |  |