I had the same problem, after checking the innerExceptions I found out that
this is a problem of the mailserver not allowing you to relay e-mail. Check
your inner exceptions,
Dim sw As New System.IO.StreamWriter("<YourWebLocation>\err.log" , True)
sw.WriteLine("Error " & vbCrLf & vbCrLf & ex.Message)
sw.WriteLine("InnerException 1 = " & vbCrLf & vbCrLf &
sw.WriteLine("InnerException 2 = " & vbCrLf & vbCrLf &
if there is a relay problem then DON'T set the smtpServer property, just dot
it like this :
MailMessage message = new MailMessage();
// set params here
// SmtpMail.SmtpServer = "mail.myispmailserver.com";
that worked for me !!
Hope this helps.
Jurjen de Groot
"Nathan Alden" <liverpghotmail.com> wrote in message
news:eR9p8GtODHA.2316TK2MSFTNGP11.phx.gbl...still> I've already searched Google. I've already asked people in IRC. I haveapplication> not found a solution that works for me for this extremely discouraging
> apparent bug in the SmtpMail class.
> MailMessage message = new MailMessage();
> // set params here
> SmtpMail.SmtpServer = "mail.myispmailserver.com";
> This works if I run it in a console application on my Windows Server 2003
> box. However if I execute the *exact same code* from my ASP.NET> I receive the error message in the subject line.
> I have heard various "fixes" for this, including setting permissions on
> mailroot, and "explanations," including "the process ASP.NET serves pages
> under is not allowed to create sockets except to localhost."
> Will someone, preferrably from Microsoft, please tell me why this error
> occurs (the REAL reason) and what I can do to get around it? Using an SMTP
> virtual server on this box is undesirable.
> Nathan Alden