SlideShare a Scribd company logo
1 of 4
Download to read offline
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

Similar to How_Sending Mails via SQL-Server.pdf

Patterns: Implementing an SOA Using an Enterprise Service Bus
Patterns: Implementing an SOA Using an Enterprise Service BusPatterns: Implementing an SOA Using an Enterprise Service Bus
Patterns: Implementing an SOA Using an Enterprise Service BusBlue Atoll Consulting
 
Project final report
Project final reportProject final report
Project final reportALIN BABU
 
Daemons Frequent and Urgent Net1 Final edit
Daemons Frequent and Urgent Net1 Final editDaemons Frequent and Urgent Net1 Final edit
Daemons Frequent and Urgent Net1 Final editTina Piotrowski
 
Extending sap solutions to the mobile enterprise with ibm mobile first platfo...
Extending sap solutions to the mobile enterprise with ibm mobile first platfo...Extending sap solutions to the mobile enterprise with ibm mobile first platfo...
Extending sap solutions to the mobile enterprise with ibm mobile first platfo...bupbechanhgmail
 
Microsoft Word - Quocirca - Managed Hosting in Europe - June 2009
Microsoft Word - Quocirca - Managed Hosting in Europe - June 2009Microsoft Word - Quocirca - Managed Hosting in Europe - June 2009
Microsoft Word - Quocirca - Managed Hosting in Europe - June 2009webhostingguy
 
Presentation data center design overview
Presentation   data center design overviewPresentation   data center design overview
Presentation data center design overviewxKinAnx
 
Adaptive processing servers for BO
Adaptive processing servers for BOAdaptive processing servers for BO
Adaptive processing servers for BOvinodguptaec
 
Pspice userguide ingles
Pspice userguide inglesPspice userguide ingles
Pspice userguide inglesunoenero
 
LPG Booking System [ bookmylpg.com ] Report
LPG Booking System [ bookmylpg.com ] ReportLPG Booking System [ bookmylpg.com ] Report
LPG Booking System [ bookmylpg.com ] ReportNandu B Rajan
 
Hrms and payroll 11i v3.5
Hrms and payroll 11i   v3.5Hrms and payroll 11i   v3.5
Hrms and payroll 11i v3.5abdul616
 
Delivering Operational Excellence with Innovation
Delivering Operational Excellence with InnovationDelivering Operational Excellence with Innovation
Delivering Operational Excellence with InnovationFindWhitePapers
 
Presentation data center deployment guide
Presentation   data center deployment guidePresentation   data center deployment guide
Presentation data center deployment guidexKinAnx
 
Cloud Computing Sun Microsystems
Cloud Computing Sun MicrosystemsCloud Computing Sun Microsystems
Cloud Computing Sun Microsystemsdanielfc
 
2014 10 09 Top reasons to use IBM BigInsights as your Big Data Hadoop system
2014 10 09 Top reasons to use IBM BigInsights as your Big Data Hadoop system2014 10 09 Top reasons to use IBM BigInsights as your Big Data Hadoop system
2014 10 09 Top reasons to use IBM BigInsights as your Big Data Hadoop systemToby Woolfe
 
Everything You Need To Know About Cloud Computing
Everything You Need To Know About Cloud ComputingEverything You Need To Know About Cloud Computing
Everything You Need To Know About Cloud ComputingDarrell Jordan-Smith
 
Enhancing intelligence with the Internet of Things
Enhancing intelligence with the Internet of ThingsEnhancing intelligence with the Internet of Things
Enhancing intelligence with the Internet of ThingsThe Marketing Distillery
 

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

Patterns: Implementing an SOA Using an Enterprise Service Bus
Patterns: Implementing an SOA Using an Enterprise Service BusPatterns: Implementing an SOA Using an Enterprise Service Bus
Patterns: Implementing an SOA Using an Enterprise Service Bus
 
GEF14_EventGuide_Final_LowRes_FINAL
GEF14_EventGuide_Final_LowRes_FINALGEF14_EventGuide_Final_LowRes_FINAL
GEF14_EventGuide_Final_LowRes_FINAL
 
Project final report
Project final reportProject final report
Project final report
 
Daemons Frequent and Urgent Net1 Final edit
Daemons Frequent and Urgent Net1 Final editDaemons Frequent and Urgent Net1 Final edit
Daemons Frequent and Urgent Net1 Final edit
 
Fsi10
Fsi10Fsi10
Fsi10
 
Extending sap solutions to the mobile enterprise with ibm mobile first platfo...
Extending sap solutions to the mobile enterprise with ibm mobile first platfo...Extending sap solutions to the mobile enterprise with ibm mobile first platfo...
Extending sap solutions to the mobile enterprise with ibm mobile first platfo...
 
Cloud view platform-highlights-web3
Cloud view platform-highlights-web3Cloud view platform-highlights-web3
Cloud view platform-highlights-web3
 
Microsoft Word - Quocirca - Managed Hosting in Europe - June 2009
Microsoft Word - Quocirca - Managed Hosting in Europe - June 2009Microsoft Word - Quocirca - Managed Hosting in Europe - June 2009
Microsoft Word - Quocirca - Managed Hosting in Europe - June 2009
 
Presentation data center design overview
Presentation   data center design overviewPresentation   data center design overview
Presentation data center design overview
 
Cognos v10.1
Cognos v10.1Cognos v10.1
Cognos v10.1
 
Adaptive processing servers for BO
Adaptive processing servers for BOAdaptive processing servers for BO
Adaptive processing servers for BO
 
Pspice userguide ingles
Pspice userguide inglesPspice userguide ingles
Pspice userguide ingles
 
LPG Booking System [ bookmylpg.com ] Report
LPG Booking System [ bookmylpg.com ] ReportLPG Booking System [ bookmylpg.com ] Report
LPG Booking System [ bookmylpg.com ] Report
 
Hrms and payroll 11i v3.5
Hrms and payroll 11i   v3.5Hrms and payroll 11i   v3.5
Hrms and payroll 11i v3.5
 
Delivering Operational Excellence with Innovation
Delivering Operational Excellence with InnovationDelivering Operational Excellence with Innovation
Delivering Operational Excellence with Innovation
 
Presentation data center deployment guide
Presentation   data center deployment guidePresentation   data center deployment guide
Presentation data center deployment guide
 
Cloud Computing Sun Microsystems
Cloud Computing Sun MicrosystemsCloud Computing Sun Microsystems
Cloud Computing Sun Microsystems
 
2014 10 09 Top reasons to use IBM BigInsights as your Big Data Hadoop system
2014 10 09 Top reasons to use IBM BigInsights as your Big Data Hadoop system2014 10 09 Top reasons to use IBM BigInsights as your Big Data Hadoop system
2014 10 09 Top reasons to use IBM BigInsights as your Big Data Hadoop system
 
Everything You Need To Know About Cloud Computing
Everything You Need To Know About Cloud ComputingEverything You Need To Know About Cloud Computing
Everything You Need To Know About Cloud Computing
 
Enhancing intelligence with the Internet of Things
Enhancing intelligence with the Internet of ThingsEnhancing intelligence with the Internet of Things
Enhancing intelligence with the Internet of Things
 

More from OualidBelbrik

FORMATION javascript.pdf
FORMATION javascript.pdfFORMATION javascript.pdf
FORMATION javascript.pdfOualidBelbrik
 
Formation Utlisation EMAIL.pdf
Formation Utlisation EMAIL.pdfFormation Utlisation EMAIL.pdf
Formation Utlisation EMAIL.pdfOualidBelbrik
 
Nomenclature-gestionnaire.pdf
Nomenclature-gestionnaire.pdfNomenclature-gestionnaire.pdf
Nomenclature-gestionnaire.pdfOualidBelbrik
 
COMPTABLE_ET_BUDGETAIRE_DES_OPERATIONS_PATRIMONIALES.pdf
COMPTABLE_ET_BUDGETAIRE_DES_OPERATIONS_PATRIMONIALES.pdfCOMPTABLE_ET_BUDGETAIRE_DES_OPERATIONS_PATRIMONIALES.pdf
COMPTABLE_ET_BUDGETAIRE_DES_OPERATIONS_PATRIMONIALES.pdfOualidBelbrik
 
Méthode_Creation_d_un_site_internet.pdf
Méthode_Creation_d_un_site_internet.pdfMéthode_Creation_d_un_site_internet.pdf
Méthode_Creation_d_un_site_internet.pdfOualidBelbrik
 

More from OualidBelbrik (6)

FORMATION javascript.pdf
FORMATION javascript.pdfFORMATION javascript.pdf
FORMATION javascript.pdf
 
Formation Utlisation EMAIL.pdf
Formation Utlisation EMAIL.pdfFormation Utlisation EMAIL.pdf
Formation Utlisation EMAIL.pdf
 
Formation ITIL.ppt
Formation ITIL.pptFormation ITIL.ppt
Formation ITIL.ppt
 
Nomenclature-gestionnaire.pdf
Nomenclature-gestionnaire.pdfNomenclature-gestionnaire.pdf
Nomenclature-gestionnaire.pdf
 
COMPTABLE_ET_BUDGETAIRE_DES_OPERATIONS_PATRIMONIALES.pdf
COMPTABLE_ET_BUDGETAIRE_DES_OPERATIONS_PATRIMONIALES.pdfCOMPTABLE_ET_BUDGETAIRE_DES_OPERATIONS_PATRIMONIALES.pdf
COMPTABLE_ET_BUDGETAIRE_DES_OPERATIONS_PATRIMONIALES.pdf
 
Méthode_Creation_d_un_site_internet.pdf
Méthode_Creation_d_un_site_internet.pdfMéthode_Creation_d_un_site_internet.pdf
Méthode_Creation_d_un_site_internet.pdf
 

Recently uploaded

Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesShubhangi Sonawane
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 

Recently uploaded (20)

INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 

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