cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Go to solution

.NET account confirmation email will not send

My site uses MVC 4 with login authorization. The new user registration responds with a confirmation email. It is in the form of an asynchronous task with the following code to send the message:

Snippet

MailMessage mailMessage = new MailMessage();
            mailMessage.To.Add(message.Destination);
            mailMessage.Subject = message.Subject;
            mailMessage.Body = message.Body;
             using (var client = new SmtpClient())
            {
                await client.SendMailAsync(mailMessage);
            }

In Web.config it has the following setup: (I have substituted "mydomain" for my actual domain name)

Snippet

<system.net>
    <mailSettings>
      <smtp from="formmail@mydomain.com">
        <network host="relay-hosting.secureserver.net" port="25" />
      </smtp>
    </mailSettings>
  </system.net>

The confirmation emails are not being sent and the logs have no "error" or "mail" related reports.

Is anything obvious that I'm doing wrong?

I'm new to the Community and not sure which Location to post this to.

richf1947
2 REPLIES 2
Solution

Re: .NET account confirmation email will not send

Well...I did nothing and today it works?!

richf1947

Re: .NET account confirmation email will not send

Hello this is confusing im just trying to make everything smooth time is important