Re: SMTP "Relay Denied" on localhost! (windows server 2003)




Try this homemade library:
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!138.entry

AND

Some notes I found in my commented code:
// see http://www.systemwebmail.com/faq/4.2.3.aspx
// for common issues
// Make sure you GRANT relay privledges for "127.0.0.1"

/*
*
* Suggestion 2
If you are using "localhost" or "127.0.0.1" as
the SmtpMail.SmtpServer, you may not have permissions
to relay through the IIS SMTP Service.
To allow access, open up the IIS Admin MMC.
Locate the SMTP Virtual Server, and right-click,
then select Properties. On the Access tab, click the Relay button.
In the Relay Restrictions dialog, grant your IP address (127.0.0.1)
to the Computers listbox. Close down all dialogs,
and restart the SMTP Service.
*/

//Also check that the SMTP service is running on your machine.




"Carmine [www.thetotalsite.it]" <pikachu31@xxxxxxxxx> wrote in message
news:2E7FDA1C-A333-4C50-94AD-6AC2FFAA7B59@xxxxxxxxxxxxxxxx
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.SmtpClient("smtp.thetotalsite.it", 25)
Dim bodyMSG As String
bodyMSG = "something"
smtp.Send("something@xxxxxxxxxxxxxxx",
someone@xxxxxxxxx, "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.SmtpFailedRecipientException: Mailbox unavailable. The
server response was: Relay denied
at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender,
MailAddressCollection recipients, String deliveryNotify,
SmtpFailedRecipientException& exception)
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at System.Net.Mail.SmtpClient.Send(String from, String recipients,
String
subject, String body)
at controls_comments.Submit_Click(Object sender, EventArgs e)

So, "Relay denied"... But I'm using an existing email account!
(something@xxxxxxxxxxxxxxx) 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


.