473,667 Members | 2,760 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[c# form] SMTP server verification?

77 New Member
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 1699
JamieHowarth0
533 Recognized Expert Contributor
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 Recognized Expert Contributor
This might also come in useful:

https://forums.microsof t.com/MSDN/ShowPost.aspx?P ostID=540202&Si teID=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 New Member
thanks very much for your help. fairly easy to implement. found this class file
http://www.c-sharpcorner.com/uploadfile/tylerkline/telnetscripting 11282005001158a m/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
3656
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 action="form.py/email" method="POST"> Name: <input type="text" name="name"><br> Email: <input type="text" name="email"><br> Comment: <textarea name="comment" rows=4 cols=20></textarea><br> <input type="submit"> </form>
2
1451
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" style="text-align: left; line-height: 100%"> <p><input type="value" name="Job" size="21">
2
5214
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 running IIS on my home machine. My problem is that I need to upload this stuff to a webhosting place and register a domain and I'm not sure what to put as the smtp mail server value
4
4325
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 CDONTS component method. Can I just to localhost server to test, whether the form can be send up to the admin's email. Or I must have the Hosting server to do that. Can Anyone suggest me, how to I test my scripts can be successfully run (at...
2
1215
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 machine as the HTTP server. A simple reference with lots of pictures and sample scripts would be much appreciated. I was referred to this page in another newsgroup http://www.aspfaq.com/show.asp?id=2026 and I have a question about a line of code...
2
2279
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
6652
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 personal email account. Yet, when i configure the email sending setting, it requires me to enter my SMTP server name/ip address. My question is how to know my smtp server since im using home network? TQ (" ,)
3
2016
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 originally directed to an .asp file on a remote server, which updates a database and sends a copy of the form via mail.(For various reasons, the remote server with its ASP script must do the form processing). To use the image verification, the form...
5
2335
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 via SMTP. Since smtplib.SMTP uses blocking IO, it can block the whole interpreter. Sometimes the whole thing would stop working indefinitely. I'm now aware that Twisted offers a non-blocking SMTP class, but I didn't really want to make that a...
0
8366
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8790
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8565
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8650
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6206
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2017
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1779
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.