473,385 Members | 1,311 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

[c# form] SMTP server verification?

77
is there a way to verify a SMTP server?

for instance.
my users specify the SMTP server depending on there local settings.
if they put in a wrong smtp address it will still attempt to send the email and wont display a fail.

is there anyway to verify the server is a smtp server?
or any other methods of verification i can take to check this?

in basic a way of saying
"hello server, do you have SMTP?"
"No."
;) haha

Thanks in advance,
Piercy
Aug 24 '07 #1
3 1691
JamieHowarth0
533 Expert 512MB
Hi Piercy,

I am a complete n00b on C# but I think this might help you:

http://www.jscape.com/articles/telnet_using_csharp.html

I understand that you may not want to fork out on a third-party API/ActiveX object for a single function, but I figure that if you can create a telnet object in C# using the .NET Framework, and then telnet to the port 25 of the server requested, then do an EHLO command ("do you send mail?" lol). If you get a response, great, send the mail through. If not, kick your user to find a decent server lol.

Hope it helps!

medicineworker
Aug 24 '07 #2
JamieHowarth0
533 Expert 512MB
This might also come in useful:

https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=540202&SiteID=1

There's also a link on there to a C# class that you can download and then use it's methods to create a telnet session.
Aug 24 '07 #3
piercy
77
thanks very much for your help. fairly easy to implement. found this class file
http://www.c-sharpcorner.com/uploadfile/tylerkline/telnetscripting11282005001158am/telnetscripting.aspx

didnt really need to use the EHLO command. the fact that it connects to port 25 is enough proof a SMTP server exists.

so for this class file i just did
Expand|Select|Wrap|Line Numbers
  1. if(telnet.Connect())
  2. {
  3. // do summit
  4. }
  5. else
  6. {
  7. //display error
  8. }
  9.  
Thanks for your help :)
Aug 24 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Nancy | last post by:
Hi, Guys, I am new to Python. I am trying to following the example on http://www.modpython.org/live/current/doc-html/tut-pub.html In this example, it gives the following html code, <form...
2
by: Dryballs | last post by:
Totally New at this so please bear with me. Is there any way to email the my form and data to make more readable? Thanks Time.asp </form> <FORM method="POST" action="/cgi-bin/sendmail.asp"...
2
by: Mindful_Spirit | last post by:
I'm trying to set up a basic email feed back form like this, and was wondering about some basic configuration settings. I have used code from this website. I have it working just fine. I'm...
4
by: CK | last post by:
Hi all, I know this question is stupid. But i need some advice for this. I am trying to develop a website, which will allow the user send to order form to the admin email. I am planning to use the...
2
by: \Crash\ Dummy | last post by:
I would like to use a form on my web site to e-mail user comments to me. I have ASP capability to run server side scripts. The host domain has a SMTP server, but I don't know if it is on the same...
2
by: darin dimitrov | last post by:
Hello, Is there a way to verify that a particular account exists on SMTP server before sending email to it in an ASP.NET web application?
1
by: team83 | last post by:
Hi, I had installed windows 2003 server to my home PC. And i had downloaded and installed a link verification tool to it. This software produces a report which i want it to be emailed to my...
3
clintw
by: clintw | last post by:
My problem. I have a html contact form that is being spammed. So I have set .html to be treated as .php, in order to include php image verification into the form. However, the Action on the form...
5
by: Gordon Messmer | last post by:
I believe that I've seen this discussed previously, so maybe there's some interest in it. I wrote a threaded mail filtering framework a while ago, and one of the modules does address verification...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.