tags:

views:

126

answers:

1

I have the following code to send an email:

System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient();
client.Send([email protected], "[email protected]", "test", "test");

Now because I'm sending it from my own work PC, I have IIS 5.0 setup and obviously most email servers on the recipients side will assume this could be spam as its coming from a ADSL IP. So I authenticate the code above using:

client.Credentials = new System.Net.NetworkCredential(myEmailHere, myPasswordHere);

But it still won't send to some clients. Is there a way around this? Eventually this code will sit on a RackSpace server, how could/would I set it up to make sure the recipient servers do not think its spam?

+3  A: 

Having your email not flagged as spam is a huge and challenging topic.

The first, best rule is:

  • Sent from a static IP address, not one part of a recycled pool (like from a DSL/Cable provider, virtual server host, etc). Check to see if the previous owner used it for spam by sending test emails to your test accounts at hotmail, yahoo, gmail, etc.
  • Never send spam from that address (including anything that more than a few people might flag as spam, even if you think it's not)

If you're serious about sending a significant amount of legitimate email and not getting flagged as spam, you have a lot to learn beyond what you can get from SO. Here are a few resources to get you started down that path:

Avoid Blacklist Blues

Avoid Being Blacklisted

How to Avoid Blacklists

Eric J.
Nice points. I tend to route all our email traffic through third party smtp servers. Gmail, Jango, Yahoo, etc. are all going to be better than you or I at keeping server IP's off the blacklists.
Joel Potter