Madhuranath


Hi I have difficulty in sending message to different reciepients. I am using SSIS package to send in the parameter. If anybody could help to resolve will be great.

Thanks

declare @MailMsg varchar(1000)
select @MailMsg = 'Hi there,
Here are the Documents Nos. and details
Status.

Thank you.'
exec master.dbo.xp_sendmail
@recipients = ,
@subject = 'Documents Status',
@message = @MailMsg,
@attachments = 'C:\MyWork\Document.XLS'




Re: Sending Message Using xp_sendmail

Crispin


I look into my crystal ball but it seems broken. What exactly are the difficulties you are having Any errors Why are you using xp_Sendmail Why not use SSIS's Send Mail Task Much easier to maintain and simple to use.






Re: Sending Message Using xp_sendmail

Madhuranath

I am using xp_sendmail, coz i can send the parameter for reciepient. I am not sure how to send in the parameter for the send mail component. If you could share some idea on how to dynamically change the "To" parameter and configure the SMTP server to outlook will be great.




Re: Sending Message Using xp_sendmail

Crispin

As with most things in SSIS, you can use an expression to change most, including the recipient. See the expressions editor.

Configuring the SMTP connection is equally as simple. Enter the address of an smtp server such as your internal mail server. Ensure that it is enabled for SMTP. Speak to your network admin.

A quick check in BOL will show you samples of how to set these things up.







Re: Sending Message Using xp_sendmail

Leonar Mwangi

I think xp_sendmail is no longer supported by SQL 2005, you'll have to use sp_send_dbmail which is its replacement



Re: Sending Message Using xp_sendmail

Phil Brammer

Leo Mwangi wrote:
I think xp_sendmail is no longer supported by SQL 2005, you'll have to use sp_send_dbmail which is its replacement


No, it is still supported, though it is marked for deprecation in a future version. sp_send_dbmail is a better, more forward-looking approach.





Re: Sending Message Using xp_sendmail

Leo Mwangi

Does SQL still need a MAPI client to use it



Re: Sending Message Using xp_sendmail

Phil Brammer

Leo Mwangi wrote:
Does SQL still need a MAPI client to use it


No. sp_send_dbmail uses SMTP.





Re: Sending Message Using xp_sendmail

Leo Mwangi

I meant for xp_sendmail to still work in SQL 2005



Re: Sending Message Using xp_sendmail

Phil Brammer

Leo Mwangi wrote:
I meant for xp_sendmail to still work in SQL 2005

I would guess, yes, xp_sendmail requires MAPI. Search books on-line to confirm for yourself though.