Search code examples
c#smtphmail-server

Hmailserver C# SMTP


I'm just trying to get my hmailserver to send mail from my C# program. The part that's killing me is the SSL part.

I originally got this error: The SMTP server requires a secure connection or the client was not authenticated. The server response was: SMTP authentication is required.

So I added: smtp.EnableSsl = true; and now I get Server does not support secure connections.

Here is my code, this is driving me nuts. Do I have to create my own SSL or is there a way to disable SSL on hmailserver side?

MailMessage mail = new MailMessage("[email protected]", "com", "NEW Item", emailBody);
SmtpClient smtp = new SmtpClient("1.1.1.250");
smtp.Port = 25;
NetworkCredential login = new NetworkCredential("[email protected]", "dg");
smtp.Credentials = login;
smtp.EnableSsl = true;
smtp.UseDefaultCredentials = false;
smtp.Send(mail);

Solution

  • Ahh okay what you have to do is in HMailServer go to advanced- ip ranges. Create a new IP range for example if you 192.168.1.2, you have to make the range 192.168.1.1-192.168.1.3, then at bottom uncheck all the required smtp authentication boxes.

    Annoying...