开发者

Cant connect/send from hMailServer [closed]

开发者 https://www.devze.com 2023-04-07 15:02 出处:网络
Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 10 years ago.

Improve this question

I have recently setup hMailServer.

I have a domain on godaddy so I am using the MX record given by godaddy. For this exampl开发者_高级运维e, 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.

Cant connect/send from hMailServer [closed]

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.


Maybe your provider has blocked outbound traffic to other SMTP servers than the server of your provider?

Find your providers SMTP server address and test it with that address.

0

精彩评论

暂无评论...
验证码 换一张
取 消