<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Marslert Guy - A walking guy to the M@rs &#187; MSSQL 2005</title>
	<atom:link href="http://marslert.com/blog/tag/mssql-2005/feed/" rel="self" type="application/rss+xml" />
	<link>http://marslert.com/blog</link>
	<description>M@rsGuy</description>
	<lastBuildDate>Tue, 21 Jul 2009 17:41:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Configure MSSQL 2005 Database Mail</title>
		<link>http://marslert.com/blog/2009/03/16/configure-mssql-2005-database-mail/</link>
		<comments>http://marslert.com/blog/2009/03/16/configure-mssql-2005-database-mail/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 15:32:29 +0000</pubDate>
		<dc:creator>marslert</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[MSSQL 2005]]></category>

		<guid isPermaLink="false">http://marslert.com/blog/?p=127</guid>
		<description><![CDATA[Due to I am working at a hosting company, coping with Linux and Windows server issues are my daily routine job. I have to keep update myself, learning new stuff. Even my blog share more about Linux stuff, but I will share anything relate to Windows if I ever learn about it. So, I am [...]]]></description>
			<content:encoded><![CDATA[<p>Due to I am working at a hosting company, coping with Linux and Windows server issues are my daily routine job. I have to keep update myself, learning new stuff. Even my blog share more about Linux stuff, but I will share anything relate to Windows if I ever learn about it.</p>
<p>So, I am going to discuss about configuring MSSQL 2005 database mail in this topic. It is actually a function in MSSQL 2005 configured for sending email. However, MSSQL database mail function will connect to the configured mail relay service for relaying mail.</p>
<p><span id="more-127"></span></p>
<p><strong>Configuration Steps of Database Mail (<em>Log in via Windows Authentication mode</em>)<br />
</strong></p>
<p><img class="size-full wp-image-128 alignnone" title="database-mail-in-object-explorer" src="http://marslert.com/blog/wp-content/uploads/2009/03/database-mail-in-object-explorer.jpg" alt="database-mail-in-object-explorer" width="237" height="287" /></p>
<p>Yeah&#8230; Pictures tell thousand of words.</p>
<p><img class="size-full wp-image-129 alignnone" title="1" src="http://marslert.com/blog/wp-content/uploads/2009/03/1.jpg" alt="1" width="298" height="173" /></p>
<p>Choose <strong><em>Set up Database Mail</em></strong> in <strong>Database Mail Configuration Wizard</strong></p>
<p><img class="size-full wp-image-133 alignnone" title="21" src="http://marslert.com/blog/wp-content/uploads/2009/03/21.jpg" alt="21" width="660" height="546" /></p>
<p>A message saying <strong>Database Mail feature is not available</strong> will be prompted. Click <strong>Yes</strong> to enable it.</p>
<p><img class="size-full wp-image-131 alignnone" title="3" src="http://marslert.com/blog/wp-content/uploads/2009/03/3.jpg" alt="3" width="610" height="122" /></p>
<p>Create a new <strong>Database Mail</strong> profile</p>
<p><img class="size-full wp-image-134 alignnone" title="41" src="http://marslert.com/blog/wp-content/uploads/2009/03/41.jpg" alt="41" width="663" height="548" /></p>
<p>At the next wizard page, entering the SMTP relay server information. You could use IIS SMTP, mail server, etc.</p>
<p><img class="size-full wp-image-135 alignnone" title="5" src="http://marslert.com/blog/wp-content/uploads/2009/03/5.jpg" alt="5" width="587" height="506" /></p>
<p><strong>Managing Profile Security</strong></p>
<p><img class="size-full wp-image-136 alignnone" title="6" src="http://marslert.com/blog/wp-content/uploads/2009/03/6.jpg" alt="6" width="660" height="554" /></p>
<p>The profile can be either Public or Private. Assiging to Public means every users can use this profile. A private profile is accessible by specific users or roles only.</p>
<p><strong>Configuring System parameters </strong>- Place for configuring the Database Mail parameters</p>
<p><img class="size-full wp-image-137 alignnone" title="7" src="http://marslert.com/blog/wp-content/uploads/2009/03/7.jpg" alt="7" width="660" height="554" /></p>
<p>Click Next to complete the configuring.</p>
<p>After finish, open a Query screen and entering below sql command to test the Database Mail function.</p>
<blockquote><p>EXEC msdb.dbo.sp_send_dbmail @profile_name = &#8216;DBMailProfile&#8217;, @recipients = &#8216;recipient@domain.com&#8217;, @body = &#8216;This is a sample email&#8217;, @subject = &#8216;Subject: Database Mail&#8217;</p></blockquote>
<p>Can always use <strong>View Database Mail Log</strong> function to check the sending process.</p>
<p><img class="size-full wp-image-138 alignnone" title="8" src="http://marslert.com/blog/wp-content/uploads/2009/03/8.jpg" alt="8" width="323" height="106" /></p>
<p>Note : Above SQL query is executable by sa user only. How if a specific users that need to execute this query? To allow specific user uses above created profile for sending email, this user must be a <strong>user</strong> in msdb database and a <strong>member</strong> of the <em><strong>DatabaseMailUserRole</strong></em> database role in msdb database. Once this permission has been granted, execute below sql query</p>
<blockquote><p>EXEC msdb.dbo.sp_addrolemember @rolename = &#8216;DatabaseMailUserRole&#8217;<br />
,@membername = &#8216;&lt;user or role name&gt;&#8217;;<br />
GO</p></blockquote>
<p>Done. This particular user can log in SQL Server Management Studio to execute MSSQL 2005 Database Mail sql command.</p>
<p>Enjoy reading.</p>
]]></content:encoded>
			<wfw:commentRss>http://marslert.com/blog/2009/03/16/configure-mssql-2005-database-mail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
