<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>sysmail_allitems on SQL Server Scripts</title><link>https://www.sqlserver70.com/tags/sysmail_allitems/</link><description>Recent content in sysmail_allitems on SQL Server Scripts</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>SQLServer70.com</copyright><atom:link href="https://www.sqlserver70.com/tags/sysmail_allitems/index.xml" rel="self" type="application/rss+xml"/><item><title>Configure Database Mail and Send a Test Message</title><link>https://www.sqlserver70.com/post/sql-server-database-mail-configuration-and-test-script/</link><pubDate>Wed, 01 Jul 2026 00:00:00 +0000</pubDate><guid>https://www.sqlserver70.com/post/sql-server-database-mail-configuration-and-test-script/</guid><description>
&lt;p&gt;Database Mail is switched off on a new instance, and &lt;code&gt;sp_send_dbmail&lt;/code&gt; cannot work until an SMTP account, a profile that holds it, and a grant that lets users send through that profile all exist in &lt;code&gt;msdb&lt;/code&gt;. The script below enables the feature, builds those three objects, sends a test message, and reads the queue and the event log to show what happened to it.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="8593449130"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="purpose-and-overview"&gt;Purpose and Overview&lt;/h2&gt;
&lt;p&gt;The Database Mail Configuration Wizard in SSMS builds the same account, profile and security objects this script does, but a wizard run leaves nothing to review, store in source control or replay on the next instance. A T-SQL script does, which makes it the better tool when more than one server needs identical mail settings, and the wizard stays useful for one-off changes and for the Configure System Parameters page.&lt;/p&gt;</description></item></channel></rss>