SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Old Forums
 CLOSED - General SQL Server
 sending email
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

enak
Starting Member

34 Posts

Posted - 09/13/2006 :  14:16:04  Show Profile
I need to be able to send a number of emails to users. This needs to be done at 12:00am.

My database is hosted on a remote server that I don't have access to SQL Mail under support services but I do have access to email via DTS.

Can I create a stored procedure that will retrieve all of the records that need to be emailed (one record = one email) and send this out via the DTS package?

Thanks,
enak

timmy
Flowing Fount of Yak Knowledge

Australia
1242 Posts

Posted - 09/13/2006 :  17:46:23  Show Profile  Visit timmy's Homepage
You can do this via an ActiveX task (by writing some VBA script that calls the CDO libraries) or you can use the Send Email task in DTS. It's not as flexible as CDO but it should do the job.
Go to Top of Page

enak
Starting Member

34 Posts

Posted - 09/15/2006 :  14:44:55  Show Profile
I think that I need to use the send mail task in DTS but I do not know how to do this. I will be executing the DTS at around mid-night each night. There will be multiple emails sent out. Can I create a DTS package that will execute a stored procedure and for each record retrieved send an email to the recipient using Send Mail in DTS?
Go to Top of Page

timmy
Flowing Fount of Yak Knowledge

Australia
1242 Posts

Posted - 09/17/2006 :  18:02:17  Show Profile  Visit timmy's Homepage
You probably could do that, but the standard Send Mail task will generally just email a dataset to a given address. I'm sure you could adapt it do do what you want, but I think it would be easier to code it in a stored proc and use xp_sendmail.
I'm not sure, but I suspect that the Send Mail task would use the same email gateway as is used by xp_sendmail. Assuming it's a hosted environment, can your service provider give you any specifics on how they prefer you to do it?

Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000