Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Thomas Vaags 3 posts 74 karma points
    Nov 27, 2020 @ 09:41
    Thomas Vaags
    0

    "Forgot password": sendgrid with sender identity

    Has anyone succeeded in sending a "forgot passord" e-mail, using a sendgrid account with "sender identity" (e-mail account verificartion)? This fails in the console in Umbraco for me (500 error). I've tried different ports, ssl on and off etc..

    If I use a sendgrid-account without sender identity everything works fine.

    Can anyone share a working configuration?

    Many thanks!

  • Mark Pickard 23 posts 116 karma points
    Dec 09, 2020 @ 10:27
    Mark Pickard
    1

    Mine is working for my forgot password. Here is from my controller:

    using (var smtp = new SmtpClient())
                {
                    var credential = new NetworkCredential
                    {
                        UserName = "XXXXX",  // replace with valid value
                        Password = "XXXXX"  // replace with valid value
                    };
                    smtp.Credentials = credential;
                    smtp.Host = "smtp.sendgrid.net";
                    smtp.Port = 587;
                    smtp.EnableSsl = true;
                    smtp.Send(message);
                    return true;
                }
    

    And this in my web.config

     <system.net>
        <mailSettings>
          <smtp from="[email protected]">
            <network host="smtp.sendgrid.net" userName="XXXXX" password="XXXXX" />
          </smtp>
        </mailSettings>
      </system.net>
    
  • Thomas Vaags 3 posts 74 karma points
    Dec 09, 2020 @ 11:19
    Thomas Vaags
    0

    Thanks Mark! I've tried this setup (among a lot of others), but to no avail. I suspect something might be off with the sendgrid-account I'm using.

  • Mark Pickard 23 posts 116 karma points
    Dec 09, 2020 @ 11:23
    Mark Pickard
    1

    It may also be your hosting provider. I read somewhere else that hosts such as GoDaddy do not play nicely with 3rd party senders

Please Sign in or register to post replies

Write your reply to:

Draft