[Mono-list] Exception When Using System.Net.Mail
Kenneth H. Brannigan
kbrannigan at vitruviansolutions.com
Sun Dec 2 22:36:41 EST 2007
I am getting the following exception when using System.Net.Mail in
mono 1.2.4_4:
Unhandled Exception: System.Net.Mail.SmtpException: 500 5.5.1 Command
unrecognized: "AUTH LOGIN"
at System.Net.Mail.SmtpClient.Authenticate (System.String Username,
System.String Password) [0x00000]
at System.Net.Mail.SmtpClient.PerformAuthentication () [0x00000]
at System.Net.Mail.SmtpClient.Send (System.Net.Mail.MailMessage
message) [0x00000]
at MonoTestConsoleApplication.Program.Main (System.String[] args)
[0x00000]
Here is the code:
System.Net.Mail.MailMessage message = new
System.Net.Mail.MailMessage("admin at test.com", "sent at test.com");
message.Subject = "Test From Mono";
message.Body = "<b>THIS IS COOL</b>";
message.IsBodyHtml = true;
System.Net.Mail.SmtpClient server = new
System.Net.Mail.SmtpClient("localhost");
server.DeliveryMethod =
System.Net.Mail.SmtpDeliveryMethod.Network;
server.Send(message);
When I run the following code using the old System.Web.Mail namespace
it works perfectly:
System.Web.Mail.MailMessage oldMessage = new
System.Web.Mail.MailMessage();
oldMessage.To = "sent at test.com";
oldMessage.From = "admin at test.com";
oldMessage.Subject = "OLD MONO";
oldMessage.BodyFormat = System.Web.Mail.MailFormat.Html;
oldMessage.Body = "<b>THIS IS COOL</B>";
System.Web.Mail.SmtpMail.SmtpServer = "localhost";
System.Web.Mail.SmtpMail.Send(oldMessage);
Any help will be very much appreciated.
Thanks,
Ken
Kenneth H. Brannigan
CTO
Vitruvian Solutions®, LLC
Mobile: 201.602.6542
E-mail: kbrannigan at vitruviansolutions.com
Web: www.vitruviansolutions.com
The contents of this e-mail are privileged and confidential. This e-
mail is intended to be read only by the individual(s) or entity to
whom it is addressed. If you are not the intended recipient of this e-
mail, please notify the sender and delete the e-mail. Any review,
retransmission, dissemination, copying or other use of this e-mail or
its contents is strictly prohibited.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20071202/ef300918/attachment.html
More information about the Mono-list
mailing list