August 21, 2007 at 8:56 am
How to send email using xp_cmdshell? Pls. advise.
I need to create a batch file which can send email. Anyother way of doing this?
August 21, 2007 at 9:29 am
Have you considered xp_sendmail? Have a look at Books On Line.
Jez
August 21, 2007 at 9:37 am
xp_sendmail is the best way if you are looking for the server to send mail (all coming from one box).
What are you trying to do?
August 22, 2007 at 8:06 am
xp_sendmail is great when using the default mail profile.
I needed to use a different mail profile (prettied up for the users) so I ended up creating a DTS that was ran via a trigger on a table. If you needed to run batch commands you could incorporate that into the DTS with a sendmail task in the flow.
I suppose you could send mail via command line using SMTP commands, but then you are losing out on the Outlook / SQL integration which works pretty darn good.
August 22, 2007 at 4:58 pm
Terrence,
Outlook / SQL integration works well until a) the permissions for the account changes and SQL can no longer access the mailbox, b) Exchange admins reboot their server and SQL can no longer connect to Exchange requiring a restart of the service to re-establish the connection, c) to many other quirks to go on with here ...
Much better to go with a solution like XPSMTP from http://www.sqldev.net this extended stored procedure works much the same as Database Mail in SQL Server 2005.
--------------------
Colt 45 - the original point and click interface
August 24, 2007 at 2:23 am
I just used a simple mail program called blat (doesn't require installation- its just an exe)
then I use xp_cmdshell to run it.
August 24, 2007 at 8:28 am
I have set up a batch file call a .vbs script. Check out this link to the Microsoft Technet Scripting Guys archives.
http://www.microsoft.com/technet/scriptcenter/resources/qanda/nov04/hey1129.mspx
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply