I have recently setup hMailServer.
I have a domain on godaddy so I am using the MX record given by godaddy. For this example, I am going to say that I am using mail.hmailserver.net as the MX Record.
I have added the username and password under SETTINGS > Protocols > SMTP on hMailServer Administrator, and so I have the following configured.
I have added an "inbound" firewall rule that opens up Port 25 to make sure that the port is not being blocked.
I can ping my MX record and it will resolve the IP fine, but yet if I try to use the following telnet command, I am unable to connect
telnet mail.hmailserver.net 25
It tells me it is unable to connect.
Initially I was using a simple client application to test this, and I believed it might have been in my code that was causing the problem, but now I am thinking I have something configured incorrectly.
public static void Main(string[] args)
{
MailMessage message = new MailMessage();
message.From = new MailAddress("fromemail@email.com");
message.To.Add("toEmail@email.com");
message.Subject = "Test Subject";
message.Body = "Test Body";
SmtpClient client = new SmtpClient();
client.Host = "mail.hmailserver.net";
client.Port = 25;
NetworkCredential login = new NetworkCredential("Administrator", "Password");
client.Credentials = login;
try
{
client.Send(message);
}
catch (Exception exception)
{
Console.WriteLine(exception.Message);
}
}
Any ideas if I am doing it incorrectly from the screenshot above? Eventually this will be sending emails from a hosted application in IIS, I am not sure if that makes a difference.
Please Help.