Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now
Build the future of communications.
Start building for free

Email posts

  • By Will Johnson
    Send Email After Password Changes with SendGrid and Auth0 Actions Send Email After Password changes with sendgrid and auth0 actions


    The security of your customers’ data is essential and goes beyond just the application. Alerting customers when their account information changes, such as a username or password, is a great way to show customers you're looking out for them. You can pair Twilio SendGrid with Auth0 Actions to email users when their passwords change to build another layer of trust.

    This blog post will walk you through sending a password change email using SendGrid’s Mail Send endpoint with Auth0 Actions.


    • A free Twilio SendGrid Account – Sign up here.
    • A free Auth0 Account – Sign up here
    • An application in your Auth0 account. If you don't have one, you can use one of the Auth0 Quickstarts with a sample application.

    Set up SendGrid

    Before sending emails using SendGrid, you'll need to verify your Sender Identity and generate your API key. Verify the Sender Identity to confirm that …

    Read More
  • By Dhruv Patel
    Twilio SendGridとNode.jsで登録者にメール通知を送信 Send Email Notifications to Subscribers with SendGrid and Node.js Header JP

    この記事はDhruv Patelこちらで公開した記事(英語)を日本語化したものです。



    本稿では、メールによる価格通知システムを構築する方法を学びます。Sneaks APIを使用してスニーカーの価格を追跡し、特定のスニーカーの価格が下がるとTwilio SendGridのメールアラートを配信するシステムです。




    このセクションでは、まずTwilio SendGridアカウントを設定し、メール通知システムのベースを構築することで、環境設定を行います。

    Twilio SendGridのAPIキーを作成

    まず、Twilio SendGridのアカウントにログインし、管理コンソールの [API Keys] 画面に移動します。右上の [Create API Key](APIキーを作成)ボタンをクリックします。


    APIキーの名前を指定し、[Create & View](作成と表示)ボ …

    Read More
  • By Néstor Campos
    How to send Emails in C# .NET with FluentEmail, Razor, and SendGrid How to send Emails in C# .NET with FluentEmail and SendGrid

    You can send emails with the .NET libraries that come with the framework such as the APIs from the System.Net.Mail namespace. They are suitable for this kind of development, however, sometimes you need a more straightforward and powerful way to generate and send emails.

    In this post, you will learn how to generate and send emails using the FluentEmail library connected with Twilio SendGrid in a console project with .NET.


    You will need a free Twilio SendGrid account and some experience with the C# language and .NET platform to complete this tutorial. Sign up here to send up to 100 emails per day completely free of charge.

    Finally, you will need the following for your development environment:

    Read More
  • By Sam Agnew
    Using Event Webhooks for Emails with Twilio SendGrid in Node.js Copy of C02 Blog Text.png

    When sending emails with Twilio SendGrid, sometimes you want to be able to keep track of the status of these emails, such as when a recipient opens the message or reports it as spam. This is made possible by the use of Event Webhooks. Let's walk through how to use Node.js and Express to track the status of emails that you send.

    Prerequisites and dependencies

    Make sure you have the following before moving on:

    • Node.js and npm installed (do this first if you haven't already)
    • A free SendGrid account
    • An email address to test out this project
    • A domain on which you will receive emails. For the purposes of this article, I’m going to use yourdomainhere.com. You will need to replace it with your own domain name.

    We'll need to install the node modules for SendGrid and Express. To install these npm modules, navigate to the directory where …

    Read More
  • By Dhruv Patel
    Twilio SendGridでNode.jsを使いEメールを簡単に送信(SMTP編) Send Email in Node.js Using SMTP with Twilio SendGrid JP

    この記事はDhruv Patelこちらで公開した記事(英語)を日本語化したものです。

    アプリケーション開発におけるメールサービスに関して言えば、Twilio SendGridなどのクラウド側でホストされているメールAPIを使用し、ニーズに合わせて設定をカスタマイズするとよいでしょう。ただし、既存のプラットフォームでSMTP(Simple Mail Transfer Protocol)がすでに有効な場合は、広く普及しているメール標準であるSMTP経由でメールを送信する方法を採用したい場合もあるでしょう。幸いなことに、Twilio SendGridではSMTPリレーサービスを提供していますので、自前のサーバーをセットアップする必要はありません。また、これまでどおり、詳細なメトリクス、分析のトラッキング、優れた配信率の恩恵を受けることができ、X-SMTPAPIヘッダーを介してSendGridの多くの機能も利用できます。

    このチュートリアルでは、Node.jsとTwilio SendGridのSMTPリレーを使ってメールを送信する方法について説明します。

    SendGridとの連携にWeb APIとSMTPリレーのどちらを使用するかを選択できる場合は、できるだけWeb APIを使用してください。SMTPでは、サーバーとクライアントの間で必要となるプロトコル処理が多いため、遅延が大きくなり、障害点が複数発生する可能性があります。詳細については、Se …

    Read More
  • By Matt Nikonorov
    How to Reference CSS Stylesheets in Email HTML Through PHP How to reference CSS Stylesheets in Email HTML Through PHP

    It is not possible to reference CSS stylesheets in HTML-based email, as you commonly would in a web-based application by using: <link rel="stylesheet" href="style.css">.

    Depending on your emails, this might be quite problematic. Luckily, there’s a way to overcome this limitation, which you'll learn in this tutorial.


    To follow along with this article, you’ll need the following:

    Using SendGrid with Composer

    In order to use SendGrid to send emails in PHP, you’ll need to install the SendGrid PHP API Library. Do this by running the command below.

    composer require sendgrid/sendgrid

    Retrieving a SendGrid API Key and Valid Sender identity

    You’ll need a SendGrid API key and a valid sender identity in order to send emails through PHP using SendGrid.

    First, to retrieve your SendGrid API key:

    1. Log into …
    Read More
  • By Néstor Campos
    Organize Incoming Email Attachments with C# and ASP.NET Core using Twilio SendGrid Inbound Parse Organize Incoming Email Attachments with C# and ASP.NET Core using Twilio SendGrid Inbound Parse

    At times, people in many organizations must organize and associate files (such as accounts, invoices, and more) with each employee or vendor in the company. Generally, these files arrive by email to a default mailbox that is constantly monitored, but manually. In this post, you are going to learn how to organize and associate files that users send by email to a particular mailbox through Twilio SendGrid with an API built in ASP.NET.


    To complete this tutorial, you will need a free Twilio SendGrid account and experience working with ASP.NET applications using the C# language. Sign up here to send up to 100 emails per day completely free of charge.

    Additionally, the API that you are going to create needs to be publicly exposed to be accessed from Twilio SendGrid, in this tutorial you will use ngrok to test your application without the need to deploy it in …

    Read More
  • By Phil Nash
    How to build an email contact form with SendGrid and Node.js How to build an email contact form with SendGrid and Node.js

    Displaying your email address on a website can result in your email being scraped and used for spam. One way to get around this, but still allow people to contact you from your website, is to build a contact form.

    In this post you will build a contact form using SendGrid to deliver emails to your inbox without exposing your email address.

    You will build the project with Twilio Functions, but you could adapt the code to use in any Node.js environment.

    How is this different to sending an email with an API?

    When someone fills in a contact form, you might expect to receive an email in your inbox from their email address. However, to maintain a good email sending reputation, SendGrid only allows you to send emails from addresses that you have verified individually or from domains you have authenticated.

    So, instead of using the submitted …

    Read More
  • By Niels Swimberghe
    How to prevent email HTML injection in C# and .NET How to prevent email HTML injection in C# and .NET

    Every few years, the Open Web Application Security Project (OWASP) publishes a new list of the 10 most common security issues in web applications, called OWASP Top 10. There is one security flaw that has been around since the first edition in 2003, and grabbed the first spot in the 2010, 2013, and 2017 editions, and that security issue is vulnerability to injection attacks. I previously talked about injection attacks in general and more specifically, how dangerous email HTML injection attacks are and how you can prevent them. However, in this post, you'll learn how you can mitigate HTML injection attacks in .NET specifically.

    How HTML injection into emails work

    HTML injection is a vulnerability where an application accepts user input and then embeds the input into HTML. A malicious user can inject HTML through the user input so that their malicious HTML is embedded into …

    Read More
  • By Dhruv Patel
    How to Send SMTP Emails in Node.js With SendGrid Send Email in Node.js Using SMTP with Twilio SendGrid

    When it comes to email services in application development, a hosted email API – such as Twilio SendGrid – is the way to go as it offers ways to customize the setup to your needs. However, you may want to send emails through SMTP (Simple Mail Transfer Protocol) if it is already on your existing platform and since it is an email standard that's used universally. Luckily, Twilio SendGrid offers an SMTP Relay service without having to set up your own server. You’ll also still have access to in-depth metrics, analytics tracking, increased deliverability rates and even more SendGrid features through the X-SMTPAPI header.

    In this tutorial, you’ll learn how to send out emails through Twilio SendGrid’s SMTP Relay in Node.js.

    If you have the option and are still deciding whether to integrate SendGrid through our API or SMTP Relay, we highly recommend using our Web API. SMTP …

    Read More
  • Newer
    Sign up and start building
    Not ready yet? Talk to an expert.