Connecting Tech Pros Worldwide Help | Site Map

How to test SMTP server connection in C#

Member
 
Join Date: Sep 2007
Posts: 105
#1: Sep 8 '08
Hi guys,
I would like to ask your idea on how to test my SMTP server connection. I created a form where you will input SMTP info like server, port, username and password. At the end of it, I added a test connection button. Right now, I can send email using SmtpClient and MailMessage class. I tried using socket to test the connection but our server don't accept connection. Hope you can help me guys.

Thanks in advance.
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,150
#2: Sep 8 '08

re: How to test SMTP server connection in C#


Wouldn't the SmtpClient be a good test?
Reply