tags:

views:

55

answers:

2

app.config

 <system.net>
    <mailSettings>
      <smtp deliveryMethod="Network">
        <network defaultCredentials="false" host="smtp.gmail.com" password="aaa" port="587" userName="[email protected]" />
      </smtp>
    </mailSettings>
  </system.net>

C# code:

 MailMessage message = new MailMessage(email.From,
                                                      email.To,
                                                      email.Subject,
                                                      email.Body);

                message.IsBodyHtml = true;
                SmtpClient client = new SmtpClient();
                client.UseDefaultCredentials = false;
                client.EnableSsl = true;
                client.Send(message);

And mail is sent like spam. problem must be in Credentials but i do not know where. Can someone tell me what i must do that mail will not be send as spam?

Thx

+2  A: 

See this link and this. Not solving your problem in terms of technical help but if you really need to send some kind of promotional offer to a large customer base, sending it from your own code is not a best option.

You better get a package from mass email service providers because there are quite a lot of rules (Raymund's post has mentioned some rules that I am talking about) that big shots (google, yahoo, hotmail) apply that will cause your emails to go into spam folder.

Pradeep
+3  A: 

You cant handle this on the code part solely as it depends also on the server that recieves it. I worked in an email marketing company before and here are some tips you can use to avoid spams

  1. The best way is to ask major ISP's/Email Providers to add your domain (where the email is sent from) on their whitelist.
  2. Prevent as much as possible using undesirable subject and messgaes indicating words that you see in Spam like "Discount", "Urgent", "Important", "Sale" and other terms meant to grab the attention.
  3. Text-to-image ratio is a must be high. All it means is if you have image in your email add a lot of text.
  4. Include contact information and an dont forget an unsubscribe link (this is the most important one)

Then to really be sure use a spam filter test application to test your message first before sending

Raymund