Groups | Blog | Home
all groups > sql server notification services > april 2006 >

sql server notification services : SMTP delivery channel


Andy
4/25/2006 6:23:02 AM
I am using the following code in my ICF file to try and set up email
notifications.

<DeliveryChannels>
<DeliveryChannel>
<DeliveryChannelName>SMTPServer01</DeliveryChannelName>
<ProtocolName>SMTP</ProtocolName>
<Arguments>
<Argument>
<Name>SmtpServer</Name>
<Value>MailServer01</Value>
</Argument>
<Argument>
<Name>BodyEncoding</Name>
<Value>utf-16</Value>
</Argument>
</Arguments>
</DeliveryChannel>
</DeliveryChannels>

I am replacing MailServer01 with the name of our mail server. I have read
that you can ONLY use the IIS SMTP service. Is this true, or can
Notification Services just connect to the server as you can in .NET? Also,
when I submit an event and it does not send out a notification, are any log
files created? How can I tell if a notification was sent successfully?

Andy
4/25/2006 8:47:02 AM
I am providing the IP address for the SMTP server. Currently in DTS we are
using a simple activeX script to send email using the same server. Does
Notification Servies require a different level of access? I am not an admin
on the SMTP server.

Here is the script we are currently using

Set oMail = CreateObject("CDO.Message")
Set oConf = CreateObject("CDO.Configuration")
Set oFlds = oConf.Fields

With oFlds
'Set the CDOSYS configuration fields to use an SMTP server.
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'Enter name or IP address of remote SMTP server.
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "IP
address"

'Set SMTP connection timeou
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10

.Update
End With

I am hoping that we can use notification services for the same purpose, but
if it requires admin permissions then it will not work for us. I have gone
through the sample provided in BOL and am now trying to make it send an
email. Thanks for your help on this.

[quoted text, click to view]
Joe Webb
4/25/2006 10:30:45 AM
Hi Andy -

You can send mail to any SMTP server to which you have access. You
cannot, however, specify login information with the built-in SMTP
protocol. Are you fully qualifying the mail server name?

You can turn on verbose logging to get additional information in the
event log. For more info on how configure the logging
levels, set
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/sqlntsv9/html/ba1164a1-b965-48ff-9b86-da92f519be54.htm
in BOL.

HTH...

--
Joe Webb
SQL Server MVP
http://www.sqlns.com


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)

On Tue, 25 Apr 2006 06:23:02 -0700, Andy
[quoted text, click to view]
kate
4/26/2006 3:45:43 AM
the sMTP connection from NS does work with any named mail server
providing that the account that NS is running under is permitted to
send mail via that mail server. If you have followed guidelines and
created a dedicated service account for the NS service then this should
not be a problem as if this account does not currently have mail rights
then you can ask the SMTP server admin to grant send mail rights and to
confirm the 'from' mailbox that you should use.

The only problems arise with servers outside the NS domain that require
login credentials other than the account you are running under. In this
instance you then need to use the IIS SMTP to relay the mail to the
designated server and control the credentials via the relay
configuration.

with regard to logging, if you set the various log parameters in the
ADF you get reasonable logging with can be accessed via one of the
public views in NS (distributordistribution i think or something like
that) . A status code is assigned to each batch attempt which will tell
you if if was passed successfully to the mail server or not. Retry
information is recorded against the work item and requires a bit more
digging to get at, but it is there.


kate
Joe Webb
4/26/2006 6:14:00 AM
Andy - You may want to try sending to the local IIS to make sure
everything else is flowing as expected. Turn on verbose logging to see
if there is any indication in the event log. And check the statuses
and service account permissions as Kate suggested. I've blogged about
what the status numbers mean here.
http://sqlns.blogspot.com/2006/03/sqlns-status-codes.html

HTH...

--
Joe Webb
SQL Server MVP
http://www.sqlns.com


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)


[quoted text, click to view]
AddThis Social Bookmark Button