Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I often get calls from a friend of mine's company saying "ahhh our email is not working!". I thought I could write a program that would test a few things that they could run and have easy answers to my questions when they call. Things like "Is your internet connection alive?", "can you send mail but not receive it?", etc.

 

Testing the outgoing mail seems easy:

 

       Try
           Dim EmailFrom As String = "test@from.com"
           Dim EmailTo As String = "test@to.com"
           Dim EmailSubject As String = "Test"

           'compile report
           Dim EmailBody As String = "test"

           Dim email As New Net.Mail.MailMessage(EmailFrom, EmailTo, EmailSubject, EmailBody)

           Dim emailClient As New Net.Mail.SmtpClient("smtp.server.com", 587)
           emailClient.EnableSsl = True
           emailClient.Credentials = New Net.NetworkCredential("test@from.com", "passwd")

           emailClient.Send(email)


       Catch ex As Exception
           MessageBox.Show("uh oh, error!")
           End
       End Try

       MsgBox("Email sent.")

 

But how would I test their incoming pop mail server? Is there a way to analyze the results of a telnet?

 

This command:

telnet mail.server.com 110

 

returns

OK POP3 READY

 

when the server is alive.

 

Or is there a way to actually receive the test email that was just sent?

 

Any thoughts on this? Also, any other comments on things that could be tested for network/mail "up" analysis are welcome!

 

Thanks,

 

Dave

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...