Hi,
I am busy with an application that needs to send an email through my company's exchange server. But when my application tries to send the email I get the following error:
The following exception occurred: System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
Here is the code that I am using:
using
namespace
{
MailMessage mail =
mail.From =
mail.To.Add(
mail.Subject = subject;
mail.Body = body;
SmtpClient smtp =
smtp.Send(mail);
}