[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 426
  • Last Modified:

xp_smtp_sendmail - Unable to send to groups

I use xp_smtp_sendmail to send e-mail messages with attached files on a monthly basis via a scheduled dts package within SQL 2000.  I can successfully send to individuals (i.e. jdoe@company.com), however, if I try to send to a group I am not successful.  Even when I use the SMTP address for that group (i.e. IT@company.com is the SMTP address for the Information Technology mail group).  The message will not send even though the return code returns success.  Included is the SQL statement contained in the execute sql task of the
dts package.

Does anyone have any suggestions?  Thanks.

declare @rc int,
    @Month AS CHAR(2),
    @Year AS CHAR(4),
    @Message_Text AS CHAR(500)

SET @Month = MONTH(DATEADD(M,1,GETDATE()))
SET @Year =  YEAR(DATEADD(M,1,GETDATE()))
SET @Message_Text = 'This is only a test.'

exec @rc = master.dbo.xp_smtp_sendmail
    @FROM                   = N'DoNotReply@tfsi1.com',
    @FROM_NAME        = N'TFS Information Systems',
    @TO                     = N'IT@tfsi1.com',
    @priority               = N'HIGH',
    @subject                = N'This is a Test',
    @message                = @Message_Text,    
    @type                   = N'text/plain',
    @server                 = N'TFSMAIL'
select
      RC = @rc
0
tfsaccount
Asked:
tfsaccount
  • 2
1 Solution
 
Anthony PerkinsCommented:
We do this all the time, so it has to be something other than xp_smtp_sendmail.  Check the SMTP logs for any clues as to the problem.
0
 
tfsaccountAuthor Commented:
Here is the situation.
We have Exchange as our mail server.  If, while I am at work, I fire up Microsoft Office Outlook and then send an email to "finance@company.com" exchange will send an email to each of the users who belong to the exchange group "finance".  When the finance people see the email the TO will be "finance@company.com" with a little + sign next to it and they can expand the Plus to see all of the people in the group.

If I log in from home and send an email to "finance@company.com" nothing happens, nobody gets an email. Perhaps the groups only work when sending mail from within the network or while you are logged into Outlook.

The reason why I would want to send to the group is so that I dont have to hard-code the list of finance people in the DTS package.  Lets say that every Monday I have a job that runs and all of finance would like to have an email notification of the job.  If I hard code the list of people it would just be a pain in the butt to manage that.  

Do you know how to send an email from SQL which then gets sent to everyone in the gorup?

Thanks!

0
 
Anthony PerkinsCommented:
Again we do this all the time using xp_smtp_sendmail.  Namely send an email to a Distributon List. We send out around 10 to 50 a day.  The only way you are going to get to the bottom of this is looking at the logs.
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now