SlideShare a Scribd company logo
1
04 juillet 2017
Sending Mails via SQL-Server
SAPPL Mercedes-Benz
Société Algérienne pour la
Production de Poids Lourds de
Marque Mercedes-Benz SPA
Route Nationale N'5 Rouïba
Alger, Algérie
Author: ALAOUI Mohamed
Function: Ingénieur Systèmes d’information
Department : IT
Date : 04-07-2017
2
04 juillet 2017
I. Introduction:................................................................................................................................ 3
II. Advantages.................................................................................................................................. 3
III. Configuration........................................................................................................................... 3
1- Configure the account and the profile : ................................................................................. 3
2- Send the email using the procedure msdb.dbo.sp_send_dbmail........................................... 4
IV. Logs Accounts and Profiles informations : .............................................................................. 4
3
04 juillet 2017
Sending Mails via SQL-Server
I. Introduction:
This topic will describe the methods that will allow us to send notifications via mails, using
only SQL Server’s Stored procedures and Triggers, and without using any third-party
applications
II. Advantages
• Notifying DBAs and other users when SQL Server Agent jobs complete, fail, or
succeed
• Sending the results of queries via email to interested individuals
• Sending alerts when certain conditions arise on my SQL Server instances
• Save a lot of time
III. Configuration
1- Configure the account and the profile :
Account name
Profile name
Sender email address
name
4
04 juillet 2017
2- Send the email using the procedure msdb.dbo.sp_send_dbmail
IV. Logs Accounts and Profiles informations :
• To troubleshoot the email sending we can consult the log using the table
msdb.dbo.sysmail_log
• To trace the different Accounts in the Database we can consult the table
msdb.dbo.sysmail_account
• To trace the different Profile in the Database we can consult the table msdb.dbo.
sysmail_profile
Email subject
Email recipients
Email Body

More Related Content

PDF
Microsoft Word - 1763toc
DOCX
MiSys Documentation
PDF
This is
PDF
Crisp dm
PDF
design_guide_c07-464433
PDF
SPi Global Services Overview
PDF
Patterns: Implementing an SOA using an enterprise service bus (ESB)
PDF
Patterns: Implementing an SOA Using an Enterprise Service Bus
Microsoft Word - 1763toc
MiSys Documentation
This is
Crisp dm
design_guide_c07-464433
SPi Global Services Overview
Patterns: Implementing an SOA using an enterprise service bus (ESB)
Patterns: Implementing an SOA Using an Enterprise Service Bus

Similar to How_Sending Mails via SQL-Server.pdf (20)

PDF
GEF14_EventGuide_Final_LowRes_FINAL
PDF
Buy ebook Microsoft Exchange server 2007 unleashed 1st Edition Rand Morimoto ...
PDF
Project final report
PDF
Daemons Frequent and Urgent Net1 Final edit
PDF
PDF
Extending sap solutions to the mobile enterprise with ibm mobile first platfo...
PDF
Microsoft Exchange server 2007 unleashed 1st Edition Rand Morimoto
PDF
Cloud view platform-highlights-web3
PDF
Microsoft Word - Quocirca - Managed Hosting in Europe - June 2009
PDF
Microsoft Exchange server 2007 unleashed 1st Edition Rand Morimoto
PDF
Presentation data center design overview
PDF
Introducing Ibm Tivoli Service Level Advisor Ibm Redbooks
PDF
Cognos v10.1
PDF
Adaptive processing servers for BO
PDF
Pspice userguide ingles
PDF
LPG Booking System [ bookmylpg.com ] Report
PDF
Architecting Modern Data Platforms Jan Kunigk Ian Buss Paul Wilkinson
PDF
Microsoft Exchange server 2007 unleashed 1st Edition Rand Morimoto
PDF
Hrms and payroll 11i v3.5
PDF
Delivering Operational Excellence with Innovation
GEF14_EventGuide_Final_LowRes_FINAL
Buy ebook Microsoft Exchange server 2007 unleashed 1st Edition Rand Morimoto ...
Project final report
Daemons Frequent and Urgent Net1 Final edit
Extending sap solutions to the mobile enterprise with ibm mobile first platfo...
Microsoft Exchange server 2007 unleashed 1st Edition Rand Morimoto
Cloud view platform-highlights-web3
Microsoft Word - Quocirca - Managed Hosting in Europe - June 2009
Microsoft Exchange server 2007 unleashed 1st Edition Rand Morimoto
Presentation data center design overview
Introducing Ibm Tivoli Service Level Advisor Ibm Redbooks
Cognos v10.1
Adaptive processing servers for BO
Pspice userguide ingles
LPG Booking System [ bookmylpg.com ] Report
Architecting Modern Data Platforms Jan Kunigk Ian Buss Paul Wilkinson
Microsoft Exchange server 2007 unleashed 1st Edition Rand Morimoto
Hrms and payroll 11i v3.5
Delivering Operational Excellence with Innovation

More from OualidBelbrik (6)

PDF
FORMATION javascript.pdf
PDF
Formation Utlisation EMAIL.pdf
PPT
Formation ITIL.ppt
PDF
Nomenclature-gestionnaire.pdf
PDF
COMPTABLE_ET_BUDGETAIRE_DES_OPERATIONS_PATRIMONIALES.pdf
PDF
Méthode_Creation_d_un_site_internet.pdf
FORMATION javascript.pdf
Formation Utlisation EMAIL.pdf
Formation ITIL.ppt
Nomenclature-gestionnaire.pdf
COMPTABLE_ET_BUDGETAIRE_DES_OPERATIONS_PATRIMONIALES.pdf
Méthode_Creation_d_un_site_internet.pdf

Recently uploaded (20)

PDF
Computing-Curriculum for Schools in Ghana
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Presentation on HIE in infants and its manifestations
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PPTX
Lesson notes of climatology university.
PDF
Complications of Minimal Access Surgery at WLH
PDF
Classroom Observation Tools for Teachers
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
Computing-Curriculum for Schools in Ghana
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Presentation on HIE in infants and its manifestations
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Microbial disease of the cardiovascular and lymphatic systems
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
Module 4: Burden of Disease Tutorial Slides S2 2025
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Lesson notes of climatology university.
Complications of Minimal Access Surgery at WLH
Classroom Observation Tools for Teachers
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Abdominal Access Techniques with Prof. Dr. R K Mishra

How_Sending Mails via SQL-Server.pdf

  • 1. 1 04 juillet 2017 Sending Mails via SQL-Server SAPPL Mercedes-Benz Société Algérienne pour la Production de Poids Lourds de Marque Mercedes-Benz SPA Route Nationale N'5 Rouïba Alger, Algérie Author: ALAOUI Mohamed Function: Ingénieur Systèmes d’information Department : IT Date : 04-07-2017
  • 2. 2 04 juillet 2017 I. Introduction:................................................................................................................................ 3 II. Advantages.................................................................................................................................. 3 III. Configuration........................................................................................................................... 3 1- Configure the account and the profile : ................................................................................. 3 2- Send the email using the procedure msdb.dbo.sp_send_dbmail........................................... 4 IV. Logs Accounts and Profiles informations : .............................................................................. 4
  • 3. 3 04 juillet 2017 Sending Mails via SQL-Server I. Introduction: This topic will describe the methods that will allow us to send notifications via mails, using only SQL Server’s Stored procedures and Triggers, and without using any third-party applications II. Advantages • Notifying DBAs and other users when SQL Server Agent jobs complete, fail, or succeed • Sending the results of queries via email to interested individuals • Sending alerts when certain conditions arise on my SQL Server instances • Save a lot of time III. Configuration 1- Configure the account and the profile : Account name Profile name Sender email address name
  • 4. 4 04 juillet 2017 2- Send the email using the procedure msdb.dbo.sp_send_dbmail IV. Logs Accounts and Profiles informations : • To troubleshoot the email sending we can consult the log using the table msdb.dbo.sysmail_log • To trace the different Accounts in the Database we can consult the table msdb.dbo.sysmail_account • To trace the different Profile in the Database we can consult the table msdb.dbo. sysmail_profile Email subject Email recipients Email Body