My SmtpSender class has now sent its first successful email 🙂 This uses the DNS MX Lookup I have talked about in previous posts to locate the mail server for the domain you are sending an email to, and then transfers the email to the mail server via SMTP. However, there is a problem with sending to public email services such as hotmail and yahoo… Read on to find out more.
One limitation I have found, which I half expected, is that some well known public SMTP servers such as hotmail (Windows Live) do not allow dynamic IP addresses to submit emails to their servers, to help prevent spam being relayed through their servers. So unfortunately this class may not be useful for people who want to send emails directly to popular public email services such as hotmail, gmail, and yahoo. There is nothing at all I can do about this, but as the original intention for this code was for it to be used in a business environment then this does not really affect the goal of this project (because a business network would have a static IP address so would not be affected – I have confirmed this by sending a mail via my code from my work PC to hotmail and it worked fine).
I appreciate though that this may disappoint some people who have been following the progress of this project as they may have intended to use it from home user’s PCs to send to hotmail/gmail etc. So… sorry, but hopefully this class can still be useful to some people and it has certainly been worth while developing as I have learnt a lot from it.
There is still quite a lot of work to do just testing, tidying up the code, adding better error handling, adding comments etc but at least the majority of the core code is now up and running.