Click here to Skip to main content
15,915,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi guys i m trying to send the mail through exchange server in .net window application having the OS Vista as below..

MailMessage completeMessage = new MailMessage("mailroom@ericsson.com","rajendra.koranga@gmail.com", "test", "sdfsfs");
create smtp client at mail server location
SmtpClient client = new SmtpClient("localhost");
add credentials
client.UseDefaultCredentials = true;
try
{
send message
client.Send(completeMessage);
}
catch (Exception)
{
throw;//failer sending mail
}
i am getting the error as failer sending mail at throw...

can someone help me please..


thanks
Posted
Comments
Rajendra Koranga 17-Feb-12 11:58am    
hi hiller ..yes the computer operating system is vista in which i am trying to run my application ...and i have already used the IP address of the computer but its giving the same error..can u please help me..

thanks a lot...

1 solution

"SmtpClient client = new SmtpClient("localhost");"
Are you sure that your Exchange Server is running on your Vista computer? Replace "localhost" with the name - or better: with the IP address - of the computer where the Exchange Server is running on.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900