Hi everyone,
I get a really odd error while using SMTPClient.Send () function in ASP.Net.
The error is the following:
Dim smtp As New Net.Mail.SmtpCl ient("smtp.thet otalsite.it", 25)
Dim bodyMSG As String
bodyMSG = "something"
smtp.Send("some thing@thetotals ite.it",
someone@gmail.c om, "Message from thetotalsite", bodyMSG)
Well, on my local machine (using the integrated web server of Visual
Studio), it works...
Incredibly, on the remote web server, it does not work!
It seems as if the web server filtered emails coming from localhost/ASP.Net
runtime o.O
The runtime give me this error:
System.Net.Mail .SmtpFailedReci pientException: Mailbox unavailable. The
server response was: Relay denied
at System.Net.Mail .SmtpTransport. SendMail(MailAd dress sender,
MailAddressColl ection recipients, String deliveryNotify,
SmtpFailedRecip ientException& exception)
at System.Net.Mail .SmtpClient.Sen d(MailMessage message)
at System.Net.Mail .SmtpClient.Sen d(String from, String recipients, String
subject, String body)
at controls_commen ts.Submit_Click (Object sender, EventArgs e)
So, "Relay denied"... But I'm using an existing email account!
(something@thet otalsite.it) and, in fact, it works perfectly on Outlook
Express or Visual Studio.
Why this strange behavior? Is it a bug? How can I solve it?
Thanks in advance,
P.s.: I'm using .Net Framework 2.0.
--
Carmine
Webmaster di www.thetotalsite.it
Blog http://blog.thetotalsite.it
I get a really odd error while using SMTPClient.Send () function in ASP.Net.
The error is the following:
Dim smtp As New Net.Mail.SmtpCl ient("smtp.thet otalsite.it", 25)
Dim bodyMSG As String
bodyMSG = "something"
smtp.Send("some thing@thetotals ite.it",
someone@gmail.c om, "Message from thetotalsite", bodyMSG)
Well, on my local machine (using the integrated web server of Visual
Studio), it works...
Incredibly, on the remote web server, it does not work!
It seems as if the web server filtered emails coming from localhost/ASP.Net
runtime o.O
The runtime give me this error:
System.Net.Mail .SmtpFailedReci pientException: Mailbox unavailable. The
server response was: Relay denied
at System.Net.Mail .SmtpTransport. SendMail(MailAd dress sender,
MailAddressColl ection recipients, String deliveryNotify,
SmtpFailedRecip ientException& exception)
at System.Net.Mail .SmtpClient.Sen d(MailMessage message)
at System.Net.Mail .SmtpClient.Sen d(String from, String recipients, String
subject, String body)
at controls_commen ts.Submit_Click (Object sender, EventArgs e)
So, "Relay denied"... But I'm using an existing email account!
(something@thet otalsite.it) and, in fact, it works perfectly on Outlook
Express or Visual Studio.
Why this strange behavior? Is it a bug? How can I solve it?
Thanks in advance,
P.s.: I'm using .Net Framework 2.0.
--
Carmine
Webmaster di www.thetotalsite.it
Blog http://blog.thetotalsite.it
Comment