At some point, your code will be calling (depending on which version of the framework you're using) something like (.Net 2.0+, using System.Net.Mail):
SmtpClient smtp = new SmtpClient(mailServer);
smtp.Send(emailMessage);
or (.Net 1.1 using System.Web.Mail):
SmtpMail.SmtpServer = mailServer;
SmtpMail.Send(emailMessage);
In either case the string mailServer will be the name/address of the server you are sending the emails out from - this probably isn't an exchange server, it's more likely to be an SMTP server, sitting on your IIS server or host.
On the server side:
- Make sure that this server is set up to send the quantity of emails you're sending out - I can't really help too much here - try ServerFault.com I guess ;)
- See if you can turn on logging, or at least monitor the BadMail queue - that will give you some indication of whether the problem's at your end or somewhere out there.
There are a number of things that will cause a users mail server or client to consider your emails as Junk, and not accept them, however the most common ones are:
- The email comes from a different domain to the "from" address - ideally, you should ensure that your emails are sent from an address with the same domain as your server. If this is not the case, then you'll need to add a Sender Policy Framework header to the server with the address's domain to tell other mail servers that your SMTP server is allowed to send email on your behalf.
- The email contains a high number of links in comparison to the non-link text.
- The email "looks" like spam - i.e. it matches various model spam emails.
- The user hasn't entered their address correctly (you'd be surprised).
Following on from that, make sure that the From address actually exists at your end - that way you can monitor bounce-backs from remote servers and see what reasons they are giving for rejecting your emails.
Depending on the type of emails, and the amount of money you have to spend, you might want to look at using a 3rd Party mailing solution - again sadly, this is outside my area of expertise.