Last post Aug 09, 2020 08:26 AM by wimkuijp
Aug 09, 2020 05:49 AM|wimkuijp|LINK
To send a conformation mail to my users I use System.Net.Mail.SmtpClient.
While debugging this works fine but after I published my project to IIS on the same machine the emails are never received and neither is there any error message.
So does Blazor Server support SMTP or need I do something else?
Thanks in advance.
Aug 09, 2020 07:24 AM|Mikesdotnetting|LINK
So does Blazor Server support SMTP
Without seeing the code you are using, it is impossible to guess why this doesn't work for you in production.
Aug 09, 2020 08:26 AM|wimkuijp|LINK
This code works in debug mode but not after published to IIS on the same machine:
private string Send_Email(string ToMailAddress)
string Msg = "Ok";
using SmtpClient smtp = new SmtpClient();
smtp.Port = 587;
smtp.Host = "smtp.live.com";
smtp.EnableSsl = true;
smtp.UseDefaultCredentials = false;
smtp.Credentials = new NetworkCredential("...firstname.lastname@example.org", ".....");
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
using MailMessage message = new MailMessage();
message.From = new MailAddress("email@example.com");
message.Subject = "DeeDelta: Confirm your email account.";
message.IsBodyHtml = true; //to make message body as html
message.Body = "Thank you.";
catch (Exception ex)