I know this is more like a c#/unoeuro problem but i will try anyway.
When i try to send email from my page nothing happens, it works fine on localhost but not on unoeuro. Here is my code:
var smtpServer = new SmtpClient("asmtp.unoeuro.com", 587)
{
Credentials = new NetworkCredential("----", "----"),
EnableSsl = true
};
try
{
MailAddress from = new MailAddress("------");
MailAddress to = new MailAddress("------");
MailMessage mailMessage = new MailMessage(from, to);
mailMessage.Subject = ""
mailMessage.IsBodyHtml = true;
mailMessage.Body = ""
mailMessage.ReplyToList.Add(---);
smtpServer.Send(mailMessage);
}
catch (Exception)
{
throw;
}
}
Earlier today I got this error:
Transaction failed. The server response was: 5.7.1 <nt34.unoeuro.com[93.191.156.17]>: Client host rejected: Relay from servers and automated mails are not allowed, use smtp.unoeuro.com instead - For help see https://unoeuro.com/support/?s=asmtp.unoeuro.com
But i still can't find any solution, I have tried to change it from asmtp to smtp but with no luck.
Unoeuro / C# / Umbraco SMTP problem
Hello all,
I know this is more like a c#/unoeuro problem but i will try anyway.
When i try to send email from my page nothing happens, it works fine on localhost but not on unoeuro. Here is my code:
Earlier today I got this error:
But i still can't find any solution, I have tried to change it from asmtp to smtp but with no luck.
Hope someone has an idea of a solution :)
Hi Henrik
You need to use port 587 when using smtp.unoeuro.com. https://en.unoeuro.com/support/faq/mail/606/
Hi Søren
Thanks for the advice, I have now tried to add the following to my web.config:
And that does not help :/
Have you also changed var smtpServer = new SmtpClient("asmtp.unoeuro.com", 587)
To var smtpServer = new SmtpClient("smtp.unoeuro.com", 587)
Yes :/
Do you get the same error on both smtp and asmtp?
Yes, the error has not been effected by changing from asmtp to smtp...
All my controllers are located in an folder called "controller" is this okay? or do they need to be located in app_code?
I just tried to use Google smtp that doesn't work eigther...
is working on a reply...