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
  • By Niels Swimberghe
    How to better configure C# and .NET applications for SendGrid How to better configure C# and .NET applications for SendGrid

    There are a hundred different ways to provide configuration to your applications. For almost any programming language, you can use environment variables and .env files, but configuration can also be stored in other file formats like JSON, YAML, TOML, XML, INI, and the list keeps on going. However, in some scenarios configuration isn't pulled from files, but instead is pulled from Azure Key Vault, HashiCorp Vault, or a similar vault service. It is rare that your configuration will come from a single source. Luckily, there are APIs in .NET that can help you grab configuration from multiple sources and merge them together.

    In this tutorial, you'll start with an application that sends emails using Twilio SendGrid, where the configuration is fetched directly from the environment variables. You'll then refactor the app to

    • fetch configuration from multiple sources, specifically, JSON files, user-secrets, environment variables, and command-line arguments
    • bind the configuration …
    Read More
  • By Niels Swimberghe
    How to better configure C# and .NET applications for Twilio How to better configure C# and .NET apps for Twilio

    There are a hundred different ways to provide configuration to your applications. For almost any programming language, you can use environment variables and .env files, but configuration can also be stored in other file formats like JSON, YAML, TOML, XML, INI, and the list keeps on going. Though, in some scenarios configuration isn't pulled from files, but instead is pulled from a service like Azure Key Vault, HashiCorp Vault, or a similar vault service. It is rare that your configuration will come from a single source. Luckily, there are APIs in .NET that can help you grab configuration from multiple sources and merge them together.

    In this tutorial, you'll start with an application that sends text messages using Twilio Programmable SMS, where the configuration is fetched directly from the environment variables. You'll then refactor the app to

    • fetch configuration from multiple sources, specifically, JSON files, user-secrets, environment variables, and …
    Read More
  • By Niels Swimberghe
    What's new in the Twilio helper library for ASP.NET (v5.73.0 - April 2022) What's new in the Twilio helper library for ASP.NET (v5.73.0 - April 2022)

    The Twilio helper library for ASP.NET (Twilio.AspNet) is a community-driven open-source project to make integrating Twilio with ASP.NET easier, for both ASP.NET Core and ASP.NET MVC on .NET Framework. The library helps you with very common use cases like:

    • Responding to Twilio webhook requests with TwiML objects from the official Twilio SDK for C# and .NET.
    • Binding data from Twilio webhook requests to strongly typed .NET objects.
    • Validating webhook requests originate from Twilio and rejecting them if not.

    As .NET and ASP.NET is evolving, the Twilio.AspNet contributors are enhancing the library to take advantage of the newest capabilities and best practices. So what's new?

    What's old in Twilio.AspNet

    Actually, before I share the shiny new additions, let me share what is already part of the library. After all, this is the first blog post to share news about the library.

    Handle Twilio webhook requests with ASP.NET

    In previous versions …

    Read More
  • By Niels Swimberghe
    How to Send SMS without a Phone Number using C# .NET and an Alphanumeric Sender ID Send SMS without a Phone Number using C# and Alphanumeric Sender ID

    You can quickly buy a phone number using Twilio's Super Network and then use that phone number to send and receive SMS. However, not all applications require two-way messaging. What's more, there are a lot of use cases where one-way messaging is a better fit, for example: notifications, alerts, and verifications. For these kinds of scenarios, you should consider using an Alphanumeric Sender ID.

    In this tutorial, you will learn how to send SMS messages from an Alphanumeric Sender ID with C#, .NET, and Twilio Programmable SMS; but first...

    What is an Alphanumeric Sender ID

    An Alphanumeric Sender ID (or Alpha Sender) lets you send SMS messages from a sender ID that consists of a set of alphanumeric characters, instead of from a phone number.

    The biggest benefit of using Alpha Sender is that you can use an ID that is more recognizable to your users than a …

    Read More
  • By Niels Swimberghe
    SendGrid APIを使用し、C#と.NET 6でメールを送信する方法 SendGrid APIを使用し、C#と.NET 6でメールを送信する方法

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

    メールは何十年も前から存在していますが、メールを大規模に送信することはいまだ困難です。Twilio SendGridなら、スケーラビリティを気にすることなくメールを送信できます。さらに、SendGridのAPIとSDKを使えば、数分でメール送信を開始できます。

    また、SMTPを基盤とする既存のコードベースがある場合は、SMTPプロトコルを使用することもできます。本稿では、SendGrid .NET SDKと.NET 6コンソールアプリケーションを使用してメールを送信する方法をご紹介します。

    必要条件

    チュートリアルを進めるには、以下の項目が必要です。

    • .NETをサポートするOS(Windows/Mac/Linux)
    • .NET 6 SDK(ダウンロード)
    • コードエディタまたはIDE(推奨: C#プラグインを導入したVS Code、Visual Studio、JetBrains Rider)
    • Twilio SendGridのアカウント(登録はこちらから)

    .NET(Core)の古いバージョンを使用している場合でも、本稿の手順を進めることができます。ただし、わずかな調整は必要となります。

    SendGridアカウントでメールを送信するための設定

    メールを送信する前に設定する項目が2つあります。

    1つ目は、Sender Authentication(送信者の認証)の設定です。送信者の認証は、送信者がメールを送信するメールアドレスまたはドメインを所有していることを確 …

    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 Niels Swimberghe
    Don't let your users get pwned via email HTML injection Don't let your users get pwned via email HTML injection

    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 edition, and that security issue is vulnerability to injection attacks.

    What are injection attacks

    An injection attack occurs when an application accepts input and malicious users submit code into the input in an attempt to have the application execute the code. An application is vulnerable to this type of attack when the input provided by the user is embedded into application code that is then interpreted.

    The most well-known type of injection attack is SQL injection, which can occur when user input is embedded into the SQL queries. This allows malicious users …

    Read More
  • By Niels Swimberghe
    How to send ASP.NET Core Identity emails with Twilio SendGrid Send ASP.NET Core Identity emails with Twilio SendGrid

    As part of ASP.NET Identity, ASP.NET Core provides a bunch of features for account management, authentication, and authorization. ASP.NET Identity also sends emails to confirm email addresses and reset passwords, but it's up to you to implement how those emails are sent.

    In this tutorial, you will learn how to send ASP.NET Identity emails using Twilio SendGrid.

    Prerequisites

    You will need these things to follow along:

    You can find the source code for this tutorial on GitHub. Use it if you run into any issues, or submit an issue, if you run into problems.

    Configure your SendGrid account …

    Read More
  • By Niels Swimberghe
    How to send Email in C# .NET using SMTP and SendGrid How to send Emails in C# .NET using SMTP and SendGrid

    Email has been around for decades, but sending emails at scale is still hard. With Twilio SendGrid, you can send emails without worrying about scalability. You can use the SendGrid APIs to send emails, but if you're already using SMTP in your code, you can also use the SMTP protocol with SendGrid. In this post, you will learn how to send emails using SMTP, SendGrid, and a .NET 6 console application.

    This tutorial is built upon .NET 6, but all code works with older versions of .NET, including .NET Framework with minor adjustments.

    Prerequisites

    You will need the following things to follow along:

    You can find the source code for …

    Read More
  • By Niels Swimberghe
    How to create an inbound Phone Proxy without any code using TwiML Bins How to create an inbound Phone Proxy without any code using TwiML Bins

    You can quickly buy phone numbers from around the world using Twilio's Super Network. You can even specify area codes to buy a phone number that is local to a certain state, territory, or region. Combining that with Twilio Programmable Voice and Twilio Programmable SMS, you can quickly build a proxy phone number!

    A proxy phone number is a public phone number hiding your real phone number that you, ideally, would want to keep private. When the proxy phone number is dialed or receives an SMS, it will be forwarded to your private phone number.

    Why is this useful? Privacy; because:

    • You may not want to hand over your real phone number to marketeers, when signing up for services, etc. Instead, give out your proxy phone number and, if you desire, swap to a new proxy phone number as needed.
    • Maybe you are a streamer who takes …
    Read More
  • Newer
    Older
    Sign up and start building
    Not ready yet? Talk to an expert.