First of all you need to configure database mail, Please refer this article:
Now in query you need to provide @body_format tag to HTML like this and profile created profile name.

In this blog you will learn how to mail in html format using sql database mail.

DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegisterMembers onlyeBook · SQLSupabase in Practice: Build and Ship Production Apps on Postgres, from First Table to LaunchDownload nowWrite a blog post and earn +250 SHARP when it is approved.
Write a blog
Join the conversation! Your thoughts help the community grow.