Monday, March 26, 2012

Emailing from MS SQL

Hey,

I would like to set up a job to send mail out to clients on a semi-regular basis. Is there a way to mail directly from MS SQL.

or some application which I can set to interface with MS SQL and send these mails out.

I'm currently using asp.net, however, doing it through the web is very time consuming, I would much rather use some application to generate the mails on the server as it currently takes close to 20 min to send through the web interface (and that's only to 900 members, we are looking at having at least 2000 members in a few weeks). What am I looking for is something I can call perhaps with transact sql so I can run it through an ms sql server job, however any solution you have would be fantastic.

If you don't have specific details, that's fine, I'm not even sure what apps etc to look into, even a name of some technology to use (or does MS SQL have a way of doing all of this itself?)

Thanks a lot for your help, life saver ;-)have you looked at xp_sendmail in the bol??|||lol, arg, it's always something simple.

Awesome, that looks pretty much like example what I want.

Thanks a lot mate ;-)|||So worries, hope it works out for you. I have often wanted to use it but due to server setup and network admins being what they are it's never happened... :(|||it's pretty simple to set up SQLMail
the trick is to get the SQL Server agent a domain user account to use as a startup account. then just set up a user mail profile by logging in as that user account. and opening your client (Isuggest outlook 98 or newer)
it will work with any MAPI1 compatible mail server even so even lotus notes...|||KBA (http://support.microsoft.com/default.aspx?kbid=263556) to configure the SQLMail.|||even so even so even so even so

sorry i was stuck in the inner groove of sgt pepper|||Hey,

I've had a few weeks on another project, and I'm back onto this job again (um, yay?, lol).

Anyway, I have had a look over the KBA link Satya posted. I am unsure if this will solve my problem, so, here are some more details about my situation.

I have a dedicated webserver at Cradle (an internet hosting company in australia).

My machine is isolated from the other machines (I'm not 100% sure about this, but it 'seems' to be the case).

They have a mail server which is something like: host1.xxxxxx.com.au. I need to send my mail through this.

The mail I send, I also need to be able to control the <From> field.

As the user who sends the mail, needs to be the user who the message is <From>, the stuff I've read in the KBA seems to send the mail through a single mail account (correct me if I'm wrong).

Also, I don't have access to Outlook on that machine. Is there some free tool etc I can install, or will I need to ship an old copy of outlook to the server for them to install for me?

Thanks, I'll head back to the KBA and keep reading now, see if I can't try and answer my own questions (fingers crossed)|||If you don't wish to set up SQL Server with a domain account or if you don't wish to use Outlook/Exchange, there are alternatives. I use a stored procedure that just needs a SMTP server to relay mail through that I found here:

http://www.sqlservercentral.com/scripts/contributions/510.asp

You'll have to register with the site to get the script, but it's well worth it. Their script library is VERY impressive.

No comments:

Post a Comment