Send an email with Python and Sendgrid!

Поділитися
Вставка
  • Опубліковано 22 січ 2025

КОМЕНТАРІ • 20

  • @zaxduduh3298
    @zaxduduh3298 Рік тому +1

    Can I apply this tutorial in a similar sendgrid website ?

    • @kauffmananalytics
      @kauffmananalytics  Рік тому

      Yep! This code has enormous flexibility and wide applicability.

  • @andreiionescu520
    @andreiionescu520 7 місяців тому +1

    I have valided my sender address and have a python code very similar to your.
    The code runs successfully (code 202), but then it goes to sendgrid as "processed" and stays like that for 72 hours, then its being showed as "blocked" and the mail is never delivered.
    Has this issue occurred to you?

    • @kauffmananalytics
      @kauffmananalytics  7 місяців тому +1

      Hmm, I haven’t seen that one before. Googling around seems like this is a common issue. See this link for a potential solution:
      stackoverflow.com/questions/42214048/sendgrid-returns-202-but-doesnt-send-email

    • @andreiionescu520
      @andreiionescu520 7 місяців тому +1

      @@kauffmananalytics thank you for finding this, i don't know how i missed it 😆
      i indeed opened a ticket to sendgrid support, only to find out that the account is currently on suspended status
      they said they will try and fix it, hopefully it will work

  • @satarupadeb1111
    @satarupadeb1111 2 роки тому

    I got an import error. It says that there is a circular import. Can you suggest a fix for it

    • @kauffmananalytics
      @kauffmananalytics  2 роки тому

      Hi Saturapa, I’d be happy to help! If you try “import sendgrid”, does that throw an error?

    • @alysontheanalyst
      @alysontheanalyst Рік тому

      @@kauffmananalytics great video! exactly what I was looking for. I'm also getting a circular import error `ImportError: cannot import name 'SendGridAPIClient' from partially initialized module 'sendgrid' (most likely due to a circular import)`

    • @zaxduduh3298
      @zaxduduh3298 Рік тому

      @@alysontheanalystdid u fix it?

  • @dg_dotnet9616
    @dg_dotnet9616 9 місяців тому

    error 401 how to fix it?

    • @kauffmananalytics
      @kauffmananalytics  9 місяців тому

      401 is an “unauthorized” code, are you sure you’re using valid credentials?

  • @awssabah
    @awssabah 2 роки тому

    I followed your steps but with the test code from SendGrid, but I am getting this error: AttributeError: 'ForbiddenError' object has no attribute 'message' any tips?

    • @toddgilbey3979
      @toddgilbey3979 Рік тому

      Retarded isn't it? The amount of people who are quite quick to post videos of how to do something half arsed is amazing.

  • @killerboy2021
    @killerboy2021 2 роки тому +1

    source code plz

    • @kauffmananalytics
      @kauffmananalytics  2 роки тому +1

      Sure thing, you can clone the GitHub repo here: github.com/Rkauff/sendgrid-simple.git
      Alternatively, you can use the web URL: github.com/Rkauff/sendgrid-simple/blob/main/sendgrid.py
      Let me know if you need anything else!

    • @killerboy2021
      @killerboy2021 2 роки тому +1

      Thank you

    • @kauffmananalytics
      @kauffmananalytics  2 роки тому

      You’re very welcome!

  • @ajm0o
    @ajm0o Рік тому

    python_http_client.exceptions.ForbiddenError: HTTP Error 403: Forbidden
    Please Help!?

    • @kauffmananalytics
      @kauffmananalytics  Рік тому

      Hmm, a 403 error indicates your Sendgrid API Key is not valid. I would check that and start there first. Let me know if that doesn’t help.

    • @ajm0o
      @ajm0o Рік тому +1

      @@kauffmananalytics Trust that the key is correct and that you watched the video and applied the steps one by one!!