I am developing a C# application to send mail using the SMTP server of our company mail. The following is the code.
MailMessage mail = new MailMessage();
SmtpClient SmtpServer = new SmtpClient("10.203.195.48");
mail.From = new MailAddress("");
mail.To.Add("");
mail.Subject = "filename";
mail.Body = "Report";
SmtpServer.Host = "ip address fo smtp mail server.";
SmtpServer.Port = 25;
SmtpServer.Credentials = new System.Net.NetworkCredential("", "");
SmtpServer.Send(mail);
But I get this error:
mailbox unavailable.unable to relay.The system doesn't have internet connection.