View Poll Results: Would you use this SMTP server class?
- Voters
- 41. You may not vote on this poll
-
I am very interested and look forward to seeing the end result
-
I would probably give it a go when it is complete
-
I am not really interested myself but it sounds like a good idea
-
I think it would be useless
-
Nov 3rd, 2009, 03:41 PM
#1
Would you use my .NET SMTP server class?
I get the feeling that this probably isnt the best place to post this, but the forum says "drop in here to discuss anything related to VB.NET" and this is definitely only related to VB.NET and not VB6 or anything. Anyway, if its in the wrong place then feel free to move it mods/admins 
As most of you will know, an SMTP server is a server that can send and receive emails. There are questions on these forums quite often about how to use google's SMTP server or Yahoo's SMTP server for example to send an email and generally it is a bit of a pain having to rely on a free public SMTP server. This is because for one thing you dont know that it will always be there or if the details required to access it will change slightly - plus you are only supposed to use these SMTP servers to send emails from the domain that you are using the SMTP server of. So for example if you use google's server then you should only send emails from your @gmail.com address or whatever.
So I decided a while ago to try and write my own SMTP server, as a class library so that other people could use it's functionality in their own programs. As you can imagine, this is not a particularly easy task and is taking far longer than I anticipated - whilst I will probably continue to make it just for the learning experience, I am just wondering how many people would actually use something like this? I mean if lots of people tell me that they are interested in it then I'm sure I will spend a lot more time on it, but at the moment its a bit hard to find the enthusiasm when I have loads of other stuff to do and I'm only doing it for myself.
If you could just fill in the poll attached to this thread to let me know how interested you are in this that would be great 
Also, just to clarify what I am actually making, you would basically be able to just add a reference to my DLL and then do something like this:
vb Code:
Dim SmtpServer As New SmtpSender
and that's it, it would send the email (provided you have port 25 open outbound, but you need that to use the standard .NET SmtpClient class anyway so thats nothing special). You dont need to specify an SMTP server or anything, because this is the SMTP server.
Thanks
Chris
EDIT: See post #7 for a better description!
Last edited by chris128; Nov 4th, 2009 at 09:25 AM.
-
Nov 3rd, 2009, 04:41 PM
#2
Fanatic Member
Re: Would you use my own .NET SMTP server ?
I would trust Google not to randomly make their server unavailable before just some person though.
Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7
SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
[Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]
[.NET and MySQL Quick Guide]
-
Nov 3rd, 2009, 04:45 PM
#3
Re: Would you use my own .NET SMTP server ?
What do you mean "before just some person" ? I wouldnt be hosting this SMTP server or anything, it would be run from your own program so as long as you have got the DLL then it will work.
Anyway, I didnt mean they would just suddenly take it offline, I meant more like if they were to change the access details - like if Yahoo suddenly made their SMTP server require SSL for example. Even if that is not very likely, when I am creating a program I would still much rather not rely on anything external to my program if I can avoid it.
-
Nov 3rd, 2009, 04:50 PM
#4
Fanatic Member
Re: Would you use my own .NET SMTP server ?
I see; didn't catch what you meant when you said "this is the SMTP server".
So that people won't have to go through a server.
Of course I'd be all for that.
Can I change my vote to option 1?
And how the heck could anyone say it would be useless.
There is a difference between it being useless and it being useless to you.
Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7
SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
[Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]
[.NET and MySQL Quick Guide]
-
Nov 3rd, 2009, 04:52 PM
#5
Re: Would you use my own .NET SMTP server ?
Yeah I thought I might not have explained it very well lol thats why I included the code sample but I guess you could just see that and think that I had some SMTP server I was hosting hard coded into the class.
Well just to re-iterate for anyone else: What I am talking about making is a class that you can use in your own programs that will send the email directly from your PC to the recipient's email server. It will basically make your PC do the job that the SMTP server you would specify in the SmtpClient.Host property would normally do.
-
Nov 3rd, 2009, 05:08 PM
#6
Re: Would you use my own .NET SMTP server ?
So let me get this right, you're creating a .Net SMTP class that wraps the current SMTP client in the Framework?
Your thread title indicates you're going to provide the server for others to connect to to send emails out. What exactly are you making in .Net?
-
Nov 3rd, 2009, 05:21 PM
#7
Re: Would you use my own .NET SMTP server ?
lol no it doesnt wrap the current smtp client that is already in the framework at all.
and no I am not going to provide a server for others to connect to - I am providing the SMTP server class itself, so that you dont need to use something like SmtpClient to pass the message to another SMTP server for sending.
I wanted to keep it brief in the original post but obviously that has led to too much confusion, so I'll explain completely:
What happens when you use System.Net.Mail.SmtpClient
You create a new instance of SmtpClient, specify an SMTP server, then send the email right? That SMTP server that you specify can be an internal SMTP server or it can be a public external one like smtp.live.com or smtp.yahoo.com or whatever. What happens is that your program passes the SMTP message to the specified server, then that server uses what is know as an "MX Lookup" to locate the email server that handles emails for the domain you are trying to send an email to. Once it has located this server then it transfers the SMTP message to that server, and then it is up to that server to process it however it wants (for example it might store the message in some kind of mail database - i.e the Information Store in Microsoft's Exchange server).
EXAMPLE: If you use the built in .NET SmtpClient to send an email to [email protected] and you specify an SMTP server of smtp.gmail.com, this is what happens:
1. Your program passes an SMTP message to smtp.gmail.com
2. Gmail's server then uses an MX lookup to determine that the server that handles incoming emails for any @microsoft.com address is mail.messaging.microsoft.com
3. Gmail's server transfers the message to mail.messaging.microsoft.com
4. mail.messaging.microsoft.com delivers it to the internal microsoft recipient
What happens when you use my SMTP server class
You create an instance of my SmtpSender class, then tell it to send the email. You do not need to specify an SMTP server to pass the message to, because my class will do the MX Lookup itself and will then transfer the SMTP message directly to the recipient's email server. So if we run through the same example as before you can see clearly where the difference is.
EXAMPLE: If you use my class to send an email to [email protected], this is what happens:
1. Your program does an MX Lookup to determine that the server that handles incoming emails for any @microsoft.com address is mail.messaging.microsoft.com
2. Your program transfers the message to mail.messaging.microsoft.com
3. mail.messaging.microsoft.com delivers it to the internal microsoft recipient
Understand now?
-
Nov 3rd, 2009, 05:54 PM
#8
Hyperactive Member
Re: Would you use my own .NET SMTP server ?
Do want. 
Heck, I'm sure a lot of people on the net would want a class like this, so take advantage of it! Use it to advertise yourself or something!
You need a reward for all the work you put into make such a versatile way of sending emails because I bet it wasn't easy.
"The only thing that interferes with my learning is my education."
-
Nov 3rd, 2009, 06:34 PM
#9
Re: Would you use my own .NET SMTP server ?
Can you make it open-source?
-
Nov 3rd, 2009, 08:34 PM
#10
Re: Would you use my own .NET SMTP server ?
I would definitely be interested in it, even if it wasn't to become Open Source. This would make Mail Delivery programs that much easier with your DLL file.
-
Nov 4th, 2009, 04:06 AM
#11
-
Nov 4th, 2009, 09:12 AM
#12
Re: Would you use my own .NET SMTP server ?
 Originally Posted by chris128
lol no it doesnt wrap the current smtp client that is already in the framework at all.
and no I am not going to provide a server for others to connect to - I am providing the SMTP server class itself, so that you dont need to use something like SmtpClient to pass the message to another SMTP server for sending.
I wanted to keep it brief in the original post but obviously that has led to too much confusion, so I'll explain completely:
What happens when you use System.Net.Mail.SmtpClient
You create a new instance of SmtpClient, specify an SMTP server, then send the email right? That SMTP server that you specify can be an internal SMTP server or it can be a public external one like smtp.live.com or smtp.yahoo.com or whatever. What happens is that your program passes the SMTP message to the specified server, then that server uses what is know as an "MX Lookup" to locate the email server that handles emails for the domain you are trying to send an email to. Once it has located this server then it transfers the SMTP message to that server, and then it is up to that server to process it however it wants (for example it might store the message in some kind of mail database - i.e the Information Store in Microsoft's Exchange server).
EXAMPLE: If you use the built in .NET SmtpClient to send an email to [email protected] and you specify an SMTP server of smtp.gmail.com, this is what happens:
1. Your program passes an SMTP message to smtp.gmail.com
2. Gmail's server then uses an MX lookup to determine that the server that handles incoming emails for any @microsoft.com address is mail.messaging.microsoft.com
3. Gmail's server transfers the message to mail.messaging.microsoft.com
4. mail.messaging.microsoft.com delivers it to the internal microsoft recipient
What happens when you use my SMTP server class
You create an instance of my SmtpSender class, then tell it to send the email. You do not need to specify an SMTP server to pass the message to, because my class will do the MX Lookup itself and will then transfer the SMTP message directly to the recipient's email server. So if we run through the same example as before you can see clearly where the difference is.
EXAMPLE: If you use my class to send an email to [email protected], this is what happens:
1. Your program does an MX Lookup to determine that the server that handles incoming emails for any @microsoft.com address is mail.messaging.microsoft.com
2. Your program transfers the message to mail.messaging.microsoft.com
3. mail.messaging.microsoft.com delivers it to the internal microsoft recipient
Understand now? 
When it's fully explained, yes I'm interested to see the end result of this undertaking.
-
Nov 4th, 2009, 01:05 PM
#13
Re: Would you use my own .NET SMTP server class?
Wow, I think this looks very interesting I am really looking forward to try this
Last edited by Arve K.; Nov 4th, 2009 at 03:04 PM.
Reason: MAJOR typos
-
Nov 4th, 2009, 01:07 PM
#14
Fanatic Member
Re: Would you use my own .NET SMTP server class?
Looks like you're getting a good review chris
Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7
SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
[Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]
[.NET and MySQL Quick Guide]
-
Nov 4th, 2009, 01:27 PM
#15
Re: Would you use my own .NET SMTP server class?
haha lets just hope it works when its finished then, or I'm going to have a lot of disappointed people
-
Nov 6th, 2009, 03:51 PM
#16
Re: Would you use my .NET SMTP server class?
Just a quick update: I have started a blog that I will be updating with my progress on this project for anyone who is interested - http://cjwdev.wordpress.com
Of course I would still appreciate anyone else voting on the poll in this thread to give me a better idea of how many people would use something like this I'll be looking for BETA testers sometime in the near future as well but I'll post that in the appropriate part of the forum nearer the time.
-
Nov 10th, 2009, 04:10 PM
#17
Re: Would you use my .NET SMTP server class?
I voted the useless option and I want to tell you why, because it is nothing against you Chris.
There are two things that I think would cause a lot of issue with this type of class.
1.) Many ISPs (in the US at least) block outbound port 25 to prevent SPAM bots from running in their network.
Now I know some US ISPs will let you open this back up if you request it from them and are willing to sign some paperwork, but that is probably more work than it is worth for people who would be using this class.
2.) If the ISP did allow port 25, many spam blocking lists flag emails from ISPs (basically flagging a whole IP range) who give out dynamic IP addresses. This is to prevent the spam that the port 25 block stopped from point 1.
I really think that this type of class would be used by people who were targeting home users, so I really think my two points apply. Anyone targeting a business as their clients would know that the business probably has an SMTP server in house (or at least available) to send all of the email.
-
Nov 10th, 2009, 04:35 PM
#18
-
Nov 10th, 2009, 08:32 PM
#19
Re: Would you use my .NET SMTP server class?
I can respect your points. I guess the answer I would have given if I had a choice is that it is probably useless TO ME.
For your business point, I guess I can see what you are saying. I thought Exchange had the ability to require authentication when sending mail through the SMTP server, but it has been a while since I have used it, so I could be wrong. Of all of the customers I have deployed solutions to that required an SMTP server, I can only think of one that put up a fight about it.
Since you are using this for a learning project, I say keep going with it. I am sure some people may find it useful.
I would be weary of using it in a production application, as I see there could be a whole lot of things that could cause this to not work and it would probably cause more support issues for me than it is worth.
A couple of points on functionality:
1.) Make sure you can support greylisting, as it is being used more and more as an Anti-Spam technique.
2.) Make sure you test with some sort of Virus scanner that has email protection in it. I have seen those screw up more than one email app.
-
Nov 10th, 2009, 08:41 PM
#20
Member
Re: Would you use my .NET SMTP server class?
As someone said this class would be home users.
Well in South Africa. Most id not basically all users have dynamic IP addresses.
And what i have noticed when setting up local mail servers is that i still have to relay mail as quite a few ISPś dont receive mail from dynamic ip addresses in order to reduce spam.
However i love the idea. and will still try it when it is complete. I do Still see a use for it.
-
Nov 11th, 2009, 04:24 AM
#21
Re: Would you use my .NET SMTP server class?
I thought Exchange had the ability to require authentication when sending mail through the SMTP server, but it has been a while since I have used it, so I could be wrong
Yes it does, but the problem is that any internal user can authenticate with the exchange server because they are on the same domain, so they can therefore send an email from whatever address they want. I've done it before when messing around with colleagues - its funny watching them read an email that looks exactly like it came from the owner of the company and says they are being fired of course they dont usually see the funny side..
-
Nov 27th, 2009, 03:29 PM
#22
Re: Would you use my .NET SMTP server class?
Hey,
Sounds interesting!! I will take a look when its done.
Gary
-
Nov 27th, 2009, 03:45 PM
#23
Re: Would you use my .NET SMTP server class?
Thanks Gary, havent had much spare time recently to do any work on this but hoping to pick it back up next week
-
Nov 27th, 2009, 03:47 PM
#24
Re: Would you use my .NET SMTP server class?
Good stuff.
Have you thought about putting it up on CodePlex just now? That way you could get people collaborating on it.
Gary
-
Nov 28th, 2009, 08:26 AM
#25
Re: Would you use my .NET SMTP server class?
Dunno, I've never used Codeplex before. To be honest I'd rather write it all myself anyway
-
Nov 28th, 2009, 11:31 AM
#26
Re: Would you use my .NET SMTP server class?
Hey,
No worries, it was just a thought. just when you said you were going to make it open source, it made sense (in my head anyway) to pt it on somewhere like codeplex, that way you get the benefit of source at the least, and collaboration, if you wanted.
Gary
-
Nov 30th, 2009, 12:11 PM
#27
Fanatic Member
Re: Would you use my .NET SMTP server class?
Hmm, I am currently working on a small program that runs in the system tray and allows a person to manage a contact list and send emails.
I originally was jut going to support GMail since it was just for me and a friend.
But, I have since thought to expand it to yahoo and hotmail SMTP support.
However, I really think what I should do (and I dunno what took me so long to think of this since I already knew you were working on this) is to use your SMTP class and just send emails with the Reply To "field" defining where there email essentially came from. Then a user could just add an email they want the recipient to be able to respond to instead of needing login information like I am currently using. This would help with account security and make this program much simpler that I am working on. 
So, I am definitely up for using this.
Also, were you planning on allowing more than just port 25 usable? Just in case it's blocked?
Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7
SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
[Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]
[.NET and MySQL Quick Guide]
-
Dec 1st, 2009, 04:17 AM
#28
Re: Would you use my .NET SMTP server class?
Yeah you can make it use any port you want, obviously the receiving server has to support incoming SMTP requests on that port though. Had a hectic weekend buying a new car and passing my motorbike test so didnt get chance to do any more work on this I'm afraid 
EDIT: Updated progress can be found on my blog http://cjwdev.wordpress.com
Last edited by chris128; Jan 15th, 2010 at 11:52 AM.
-
Jan 17th, 2010, 08:14 PM
#29
Re: Would you use my .NET SMTP server class?
Just to let anyone know that has been following this, I have nearly got it to BETA stage now. However, there is a problem with sending emails to free public email services such as hotmail/gmail/yahoo etc from my class as these public email services do not allow dynamic IP addresses (the type of IPs that are assigned to home user's internet connections) to submit emails to them. This is basically what Negative0 mentioned in post #17.
There is nothing I can do about this unfortunately - for more info look at the "Cjwdev.Mail Progress Report 4" post on http://cjwdev.wordpress.com
Last edited by chris128; Jan 17th, 2010 at 08:33 PM.
-
Jan 18th, 2010, 02:48 AM
#30
Re: Would you use my .NET SMTP server class?
Hey,
I actually ran into this issue the other night when I was trying to set up the mail server on my server. I am used to having a static IP address, but recently switched provider, and am back to Dynamic IP address. When I tested, I got a response from Hotmail, which directed me to the following:
http://www.microsoft.com/mscorp/safe...d/default.mspx
I haven't read all of the content yet, but it seems like this is something that might help with this issue. Have you looked into this at all?
Gary
-
Jan 18th, 2010, 04:03 AM
#31
Re: Would you use my own .NET SMTP server ?
 Originally Posted by chris128
You do not need to specify an SMTP server to pass the message to, because my class will do the MX Lookup itself and will then transfer the SMTP message directly to the recipient's email server.
I'm a bit curious, how it is done in your case? Can you give a little more details, especially when the domain name provided in my e-mail and the domain name of the SMTP server are not the same (it an actual working configuration of one of my e-mails).
-
Jan 18th, 2010, 04:43 AM
#32
Re: Would you use my own .NET SMTP server ?
 Originally Posted by cicatrix
I'm a bit curious, how it is done in your case? Can you give a little more details, especially when the domain name provided in my e-mail and the domain name of the SMTP server are not the same (it an actual working configuration of one of my e-mails).
When you say "the domain name provided in my e-mail and the domain name of the SMTP server are not the same" what do you mean by "my e-mail" ? Do you mean the email address you are sending to? If so then that is not a problem because the MX records (http://en.wikipedia.org/wiki/MX_record) for your domain will tell my code (and any other server trying to send you emails) where to send the mails. This process is known as an MX Lookup and it is how SMTP servers know where to send emails. Have a look at the Cjwdev.Mail.SmtpSender post on here for a basic diagram: http://cjwdev.wordpress.com/category/cjwdev-mail/ - the DNS Server is what is responsible for returning the MX Lookup results and with my class you can either specify your own DNS server or you can have it automatically detect the DNS servers that your PC is currently using.
I actually ran into this issue the other night when I was trying to set up the mail server on my server. I am used to having a static IP address, but recently switched provider, and am back to Dynamic IP address. When I tested, I got a response from Hotmail, which directed me to the following:
http://www.microsoft.com/mscorp/safe...d/default.mspx
I haven't read all of the content yet, but it seems like this is something that might help with this issue. Have you looked into this at all?
Yeah that would help if this was just for my use, but as this code could potentially be run from any IP and any domain name etc then its not something I can use unfortunately
-
Jan 18th, 2010, 05:09 AM
#33
Re: Would you use my .NET SMTP server class?
Hey Chris,
I understand that this wouldn't work for the class that you are going to be shipping, but I thought people should be made aware of it, so that they can implement if they need it.
I was also curious if this technique worked for you, as I need to find a way around this.
Gary
-
Jan 18th, 2010, 07:32 AM
#34
Re: Would you use my own .NET SMTP server ?
 Originally Posted by chris128
Do you mean the email address you are sending to? If so then that is not a problem because the MX records.
No, mmm, I mean how does it figure out my smtp server? Or should I specify it somewhere?
Say I have an email address '[email protected]', but my smtp server is a.bcd.com.
-
Jan 18th, 2010, 08:10 AM
#35
Fanatic Member
Re: Would you use my .NET SMTP server class?
I am very interested. Isn't there a .net code somewhere in the framework that do this sort of thing?
Or what about using mercury?
-
Jan 18th, 2010, 08:30 AM
#36
Re: Would you use my .NET SMTP server class?
No, mmm, I mean how does it figure out my smtp server? Or should I specify it somewhere?
Say I have an email address ' [email protected]', but my smtp server is a.bcd.com.
You dont understand - it doesnt matter what your domain name is, every domain name that can receive emails will have MX Records, and these MX Records will point to the SMTP server that is responsible for receiving emails for that domain. Enter your domain name into this website and it will show you the MX records for your domain: http://www.mxtoolbox.com/
-
Jan 18th, 2010, 08:32 AM
#37
Re: Would you use my .NET SMTP server class?
 Originally Posted by teguh123
I am very interested. Isn't there a .net code somewhere in the framework that do this sort of thing?
Or what about using mercury?
See my explanation of the difference between my class (SmtpSender) and the .NET framework class (SmtpClient) here: http://cjwdev.wordpress.com/2009/11/...vs-smtpclient/
As for using Mercury, from what I understand that is basically a stand alone application that runs an SMTP server - I dont know about you but if I just want to send an email from my application I dont want to have to turn my user's PC into a full blown SMTP server that is active all of the time.
Last edited by chris128; Jan 18th, 2010 at 08:40 AM.
-
Jan 18th, 2010, 08:43 AM
#38
Re: Would you use my .NET SMTP server class?
 Originally Posted by chris128
You dont understand - it doesnt matter what your domain name is, every domain name that can receive emails will have MX Records, and these MX Records will point to the SMTP server that is responsible for receiving emails for that domain. Enter your domain name into this website and it will show you the MX records for your domain: http://www.mxtoolbox.com/
Oh, I got it. Slow thinking, I guess. Thanks for your patience though.
-
Jan 18th, 2010, 08:53 AM
#39
Re: Would you use my .NET SMTP server class?
No worries, I dont expect everyone to know how SMTP / DNS works
-
Jan 18th, 2010, 08:54 AM
#40
Re: Would you use my .NET SMTP server class?
Does it work with exchange?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|