Ciao a tutti
Utilizzo questo codice per inviare le mail:
static public bool SendMail(string mittente, string destinatario, string oggetto, string corpo)
{
bool res = true;

corpo = Formattazione.PulisciDocumento(corpo);
try
{
MailMessage msg = new MailMessage();
msg.From = new MailAddress(mittente, mittente);
string[] destinatari = destinatario.Replace(",", ";").Split(char.Parse(";"));
foreach (string to in destinatari)
msg.To.Add(new MailAddress(to, to));
msg.Subject = oggetto;

//********************* vedi funzione originale sotto, dovrebbe evitare antispam******
msg.BodyEncoding = System.Text.Encoding.GetEncoding("utf-8");
System.Net.Mail.AlternateView plainView = System.Net.Mail.AlternateView.CreateAlternateViewF romString
(System.Text.RegularExpressions.Regex.Replace(corp o, @"<(.|\n)*?>", string.Empty), null, "text/plain");
System.Net.Mail.AlternateView htmlView = System.Net.Mail.AlternateView.CreateAlternateViewF romString(corpo, null, "text/html");
msg.AlternateViews.Add(plainView);
msg.AlternateViews.Add(htmlView);
msg.IsBodyHtml = true; //300316
msg.Priority = MailPriority.High; //300316
//************************************************** **********************************/

SmtpClient smtpClient = new SmtpClient();

smtpClient.Send(msg);
}
catch (SmtpException smtpException)
{
res = false;
}
catch (Exception ex)
{
res = false;
}

return res;
}



<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="noreply@xxx.com">
<network host="smtp.aruba.it" userName="noreply@xxx.com" password="xxx" port="25" />
</smtp>
</mailSettings>
</system.net>



Questa è la risposta del server:
Transazione non riuscita. Risposta del server: mxcm01.ad.aruba.it bizsmtp yb1V1u00L3MquP901 Connection refused from xx.xx.xxx.xxx. See http://csi.cloudmark.com/reset-reque...=xx.xx.xxx.xxx for more information.

Ho chiesto ad Aruba è mi hanno risposto in questo modo e a dire la verità non ci ho capito nulla:
"Al momento sta effettuando l'invio delle mail tramtie il server stesso utilizzando il servizio di SMTPS e porta 465, i parametri full host name e PTR non sono settati e CloudMarck, il sistema di antispam Aruba le notifica la non configurazione del servizio.

Come da Sua descrizione volendo effettuare un servizio di SMTPS relay dovrà modificare la funzionalità impostata effettuanado una chiamata autenticata al Suo server di posta per effettuare l'invio."


Sul server, windows server 2012 r2, è stato installato un firewall. Firewall che cambia l'ip del server. Quindi la mail esce dal server con un'ip diverso.

Ho cercato, provato mille cose, ma non riesco a capire cosa fare e quale sia il problema.
Grazie mille