Sending Mail Using C#
Sending mail in PHP is pretty easy, all you need to do is check if your Linux server (if that’s what you are running) has email capability. However in .net you need SMTP server host to send mails, so here is a easy tutorial as well as source code to send mails using C#.
Prerequisites
To test your code properly, you must have an SMTP host, either running in your local machine or a remote server.
Lets Get Started
So lets get started, first of all lets look at the namespaces we will be using, please note that we will be using System.Net.Mail and not System.Web.Mail, System.Web.Mail is an outdated class. So here is the list of namespaces we will be using.
using System; using System.Collections.Generic; using System.Web; using System.Net.Mail; using System.Text; using System.Collections;
Webmail Via Firefox
Most people hate email clients and prefer webmail. Well I’m no different. Email clients are slow and they get stuck when you receive huge attachments they are prone to virus attacks and the disadvantage list goes on. Web mail on the other hand is faster easily accessible and has built in virus scanning and you only need to download an attachment when you really need to view it (and not always like an email client).
For those of you who use Firefox and multiple web mail accounts like Live, Gmail and Yahoo, here is a superb Firefox extension which notifies you when you receive the mails. I tried this out and its absolutely fantastic. For all of you web mail fans out there here is the WebMail Notifier Firefox Extension.
Simply add the username and the password of each of your accounts and the webmail notifier takes care of checking you mails in regular intervals (this can be set in the preferences) and notifying you if you receive any new mails.
Get WebMail Notifier (Firefox Add-on)
Auto Login to Live Mail Using IE While IE is Not The Default Browser
Whenever you click the new mail icon of the live messenger, you are sent to the live mail login page in whatever browser is the default in your PC, so if IE is your default browser then no problem, but most people including me prefer Firefox. Well in that case you will have to (unfortunately) manually login to your email account.
But what if you would like to login to your Live mail account using IE (without the manual login hassles, and security issues), while Firefox is still your default browser?
Auto Login to Live Mail Using Firefox
Whenever you click the new mail icon of the live messenger, you are sent to the live mail login page in whatever browser is the default in your PC, so if IE is your default browser then no problem, but most people including me prefer Firefox. Well in that case you will have to (unfortunately) manually login to your email account.
Until now there is no work around for this, but using the following GreaseMonkey script, you can login to your live mail. You have to give your username and password to this script and will automatically log you in. One major drawback is that all your security data is exposed to anyone who visits the live mail site from the specific pc, since this script automatically logs anyone who visits the live mail site.
FYI: There is an alternate more secure method HERE, choose whatever you like.
Before you install this script make sure you have the Firefox add-on GreaseMonkey
Use this script ONLY if you have your own PC with a Password protected account.

