Copied to clipboard

Flag this post as spam?

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


  • Jason H 4 posts 34 karma points
    Oct 22, 2020 @ 20:52
    Jason H
    0

    Using Sendgrid Web API for email

    How can I use Sendgrid's Web API instead of SMTP relay to send emails? For example the backoffice forgot password email. Is there are process I can override to implement this myself?

  • Jason H 4 posts 34 karma points
    Oct 23, 2020 @ 12:36
    Jason H
    0

    I've seen other threads where people ask about this and they are dead ends too. Is there not a solution to this? If that's the case could someone confirm that there isn't a solution to this?

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Oct 23, 2020 @ 13:00
    Lee Kelleher
    101

    Hi Jason,

    This is how I've been using SendGrid, with the API key for authentication...

    In my Web.config...

    <system.net>
      <mailSettings>
        <smtp>
          <network host="smtp.sendgrid.net" userName="apikey" password="{apiKey-goes-here}" port="25" />
        </smtp>
      </mailSettings>
    </system.net>
    

    The "apikey" username is standard, accordingly to the docs: https://sendgrid.com/docs/for-developers/sending-email/upgrade-your-authentication-method-to-api-keys/

    Hope this helps?

    Cheers,
    - Lee

  • Jason H 4 posts 34 karma points
    Oct 23, 2020 @ 13:02
    Jason H
    0

    Hey Lee,

    I'll give it a shot. It just threw me off to stick the API keys in the SMTP section. Thanks!

    Jason

  • Jason H 4 posts 34 karma points
    Oct 23, 2020 @ 16:34
    Jason H
    0

    What you suggested did work. I deleted my SMTP Relay key and added a new Web API key in Sendgrid. I then simply added the Web API key as the value for password in the smtp section of my Web.Config.

    I hope this helps someone else confused by this because the other threads I found were dead ends.

    I still find this really confusing since in the past when I've coded these solutions sending email via SMTP is a bit different than sending email with an API.

    Thanks again Lee!

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Oct 23, 2020 @ 17:00
    Lee Kelleher
    0

    Hey Jason, good to hear that it's all working for you!

    Cheers,
    - Lee

Please Sign in or register to post replies

Write your reply to:

Draft