Showing posts with label Email automation in SQL. Show all posts
Showing posts with label Email automation in SQL. Show all posts

Tuesday, September 6, 2016

Sending Email in HTML Table Format Using TSQL in SQL Server

As we know that SQL language is specified as an ANSI and ISO standard and performance, scalability, and optimisation are important for database-driven applications, especially on the Web.  

In application development, we are required to build a SQL program to perform certain task(s) on periodic basis or daily basis. For example - send an email alert with Department Wise Employee List from SQL Server to business users. Let us discuss how we can send an email in HTML table format using TSQL.



Friday, September 2, 2016

Enabling and configuring Database Mail in SQL Server using T-SQL

Database mail is the most useful feature of SQL Server which allows us to send email though the database. This feature can be used in reporting services, integration services and in our application also. 

By using this feature, we can easily tracks the email logs also and schedule these email alerts by the help of SQL Server Agent.

Well, we will learn how to enable and configure database mail in SQL Server using T-SQL codes without using Database Mail Configuration Wizard. 

So, we are dividing our T-SQL code into six steps which are executed in SQL one by one. 


The below steps will be defined step by steps as given below–
🔍Enable the Database Mail feature
🔍Create a profile for Database Mail
🔍Define the default profile
🔍Add an Email account with SMTP Server
🔍Add the Account to the Profile
🔍Send a test email to User’s email Address