Click here to Skip to main content
15,886,700 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I installed SMTP virtual server in SMTP host server i.e.,"10.8.12.242" and opened IIS manager as inetmgr6 in Run command. Added my ip address "192.168.2.2" in Relay and tried to run SMTP Virtual Server. It gave me below error.

"The service has returned a service-specific error code. Check the Windows Event Viewer for details"

In Event viewer it is showing below message

"Failed to connect to the Edge Transport server ADAM instance with exception The LDAP server is unavailable.. This could be caused by a failure to resolve the Edge Transport server name NDC-RD-EDG-01.rdb.local in DNS, a failure trying to connect to port 50636 on NDC-RD-EDG-01.rdb.local, network connectivity issues, an invalid certificate, or an expired subscription. Verify your network and server configuration."

My main issue is With the below code, I could able to send mails to same domain but not other domains. When I tried to send mails to other domains, it thrown exception: "MailBox UnAvailable 5.7.1. The server response was: 5.7.1 Unable to relay". I executed below code in "192.168.2.2"

C#
SmtpClient smtp = new SmtpClient();
smtp.Port = 25;
smtp.Host = "10.8.12.242";
smtp.UseDefaultCredentials = false;
smtp.EnableSsl = false;
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.Credentials = new System.Net.NetworkCredential(senderID, senderPassword);
smtp.Timeout = 30000;

MailMessage message = new MailMessage(senderID, "abcd@xyz.rw", "Information Entreprise", "Hello, that message has been sent as consiquence of mail sending test.");
try
{
    smtp.Send(message);
}
catch (Exception ex)
{
    MessageBox.Show(ex.Message);
}
Posted

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