472,121 Members | 1,485 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,121 software developers and data experts.

Procedure to send an email to a customer using procedures in SQL Server 2000

Hi,

Can you please tell what is the procedure in SQL Server 2000 to automatically send an email to the customer. I know that we can do it in DTS Packages. But what should be the code in the procedure to send a mail.

I've a code in the following link but I'm afraid its giving some errors. Kindly check the link

--

http://support.microsoft.com/kb/312839


I'll be very thankful if someone could really help me out.

Thanks in advance.
Dec 20 '06 #1
2 1493
iburyak
1,017 Expert 512MB
To send an e-mail from SQL server you have to have Microsoft Outlook or
other e-mail service installed on your server.
Also it should have generic mail account on it.
Due to security reasons it is not allowed to have an e-mail service on a server in my company so see what I do instead to send an email to msql_dba team through some_e_mail.exe that is standard built in my company. You can run any exe from xp_cmdshell with parameters the same way as you do from command prompt. Hope it will help you somehow.

[PHP]Declare @msg varchar(1000)
BEGIN
RAISERROR ('The replication latency is too high please investigate',16, 1)
select @msg = 'c:\PROGRA~1\autoproxy\ some_e_mail btell -mail msql_dba "Replication Latency on server: ' +@@servername + ' Hrs '+rtrim(cast(@h as char))+' Min '+ rtrim(cast(@m as char))+'"'
exec master..xp_cmdshell @msg
END[/PHP]
Dec 22 '06 #2
AricC
1,892 Expert 1GB
Why don't you send the email via PHP or another scripting language?
Dec 22 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.