I am creating my mvc app. I would like to send email to users that register. I do it like this:
MailMessage mail = new MailMessage();
mail.To.Add(user1.email.Replace(" ", string.Empty));
mail.From = new MailAddress("declarations@virtual.mini.pw.edu.pl");
mail.Subject = "Class Declaration System user creation confirmation.";
string body = "Dear " + user1.name + ",\n This is to confirm that you have succesfully registered in the system. \n Do not reply to this message. \n Regards";
mail.Body = body;
mail.IsBodyHtml = true;
var smtp = new SmtpClient();
smtp.EnableSsl = true;
smtp.Host = "poczta.mini.pw.edu.pl";
smtp.Port = 25;
And everything seems fine. I have contacted the administrator of the server and I am sending everything through a right port. However, I get an error:
Command parameter not implemented. The server response was: 5.5.2
> <WIN-KI3H68FIO4E>: Helo command rejected: need fully-qualified hostname
The administrator told me that this is because I am trying to send it as WIN-KI3H68FIO4E, but it should be something.mini.pw.edu.pl, since we have such restrictions here. How do I change it in my code?