app.config
<system.net>
<mailSettings>
<smtp deliveryMethod="Network">
<network defaultCredentials="false" host="smtp.gmail.com" password="aaa" port="587" userName="noreplay@aaa.si" />
</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
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.