Relay Error in Send Mail in 2.0

Relay Error in Send Mail in 2.0

am 31.03.2008 10:54:45 von rose

Hi everyone,

I am trying to send mail to external domains like gmail,hotmail via my
local network exchange server. The code works in .net 1.1 with the
User name and password [user created with full rights on the Exchange
server] provided by the Network admin to me.

Although, I still couldnt figure out the fact that if I send emails to
external domain through outlook which is configured to the same
exchange server, there isnt any problem. But when I did that through
my code, it threw our very own 550 5.7.1 relay error. Thankfully, the
problem in .net 1.1 is solved.

Now, using the same credentials, I want to send the mails through 2.0
but I get the same error.i have tried all the solutions I could find
on the net but in vain. With local host it doesnt throw an error but
the mail ends up in Badmail. Besides I want to use exchange server but
that too isnt working. There isnt any firewall issue. If there was,
then the mail in 1.1 shouldnt be working on the same machine using
same parameters and it doesnt have SSL authentication.

SmtpClient client = new SmtpClient();
client.Host = "localhost"; //If i specify my exchange
server here, it throws an error
client.Port = 25;
client.Credentials = new
System.Net.NetworkCredential("username", "pass");

I really cant understand what the problem is so please any help will
be highly appreciated :)
Thanks