* SmtpClient.cs : Replace every \r and \n with \r\n per RFC 2821
section 2.3.7, or you will receive SMTP error 451.
svn path=/trunk/mcs/; revision=87558
+2007-10-16 Atsushi Enomoto <atsushi@ximian.com>
+
+ * SmtpClient.cs : Replace every \r and \n with \r\n per RFC 2821
+ section 2.3.7, or you will receive SMTP error 451.
+
2007-10-16 Atsushi Enomoto <atsushi@ximian.com>
* AlternateViewCollection.cs, LinkedResourceCollection.cs,
private void SendData (string data)
{
- writer.Write (data);
// Certain SMTP servers will reject mail sent with unix line-endings; see http://cr.yp.to/docs/smtplf.html
+ writer.Write (data.Replace ("\r\n", "\n")
+ .Replace ('\r', '\n')
+ .Replace ("\n", "\r\n"));
writer.Write ("\r\n");
writer.Flush ();
}