I installed on a server windows server 2008 service SmarterMail. Configured interface and works perfectly. I created a software in .net c # here's the code:
MailMessage mail = new MailMessage();
mail.From = new MailAddress("[email protected]", "Prova");
foreach (string recips in email)
{
mail.To.Add(recips);
}
mail.Subject = "PRova";
mail.BodyEncoding = System.Text.Encoding.UTF8;
mail.IsBodyHtml = true;
mail.Body = messaggio;
foreach (string itemurl in file)
{
System.Net.Mail.Attachment attachment;
attachment = new System.Net.Mail.Attachment(itemurl);
mail.Attachments.Add(attachment);
}
SmtpClient smtp = new SmtpClient(server);
smtp.UseDefaultCredentials = false;
smtp.Credentials = new NetworkCredential("prova", "prova");
smtp.Send(mail);
The problem is when I send email to an address @ gmail.com. The emails come in all domains except for gmail. What can be the reason?