[Mono-list] MailMessage Recipients Exceptions

Damien DALY maitredede at gmail.com
Mon Mar 17 14:49:56 EDT 2008


Hi Steve,

- Have you tried with real mail address and credentials using existing
servers ?
- Is there an InnerException ?

Damien


2008/3/17, Steve Harp <steve at abelscreening.com>:
>
> Hi All,
>
> I'm new to the list so please excuse me if this has already been covered.
> I'm having trouble sending email.  The code below works under .NET but not
> under Mono.  The exception thrown seems to be with the way I'm specifying
> my
> recipients.
>
> private void SendTest()
> {
>         try
>         {
>                 MailMessage mail = new MailMessage();
>
>                 mail.From = new MailAddress("me at mydomain.com");
>                 mail.To.Add("you at yourdomain.com");
>
>                 mail.Subject = "This is a test";
>                 mail.Body = "This is a test\r\nThis is only a test.";
>
>                 SmtpClient smtp = new SmtpClient("smtp.myisp.net", 587);
>
>                 smtp.Credentials = new NetworkCredential("me at mydomain.com
> ",
> "mypassword");
>                 smtp.Send(mail);
>         }
>         catch (Exception ex)
>         {
>                 Log("Error Sending Email", ex);
>         }
> }
>
> /*
> =========================================
> Here's the log file...
>
> 3/17/2008 1:14:47 PM
> Error Sending Email
> System.Net.Mail.SmtpFailedRecipientsException: failed recipients
>   at System.Net.Mail.SmtpClient.SendCore (System.Net.Mail.MailMessage
> message) [0x0048c] in
> /tmp/monobuild/build/BUILD/mono-1.9
> /mcs/class/System/System.Net.Mail/SmtpCli
> ent.cs:595
>   at System.Net.Mail.SmtpClient.Send (System.Net.Mail.MailMessage message)
> [0x00052] in
> /tmp/monobuild/build/BUILD/mono-1.9
> /mcs/class/System/System.Net.Mail/SmtpCli
> ent.cs:446
>   at MainWindow.SendTest () [0x00061] in MainWindow.cs:64
>
> =========================================
> */
>
>
> Thanks for any suggestions,
> Steve
>
>
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20080317/e5cfbea5/attachment-0001.html 


More information about the Mono-list mailing list