Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How to generate email from database( MS SQL SERVER 2000 or 2005) Expand / Collapse
Author
Message
Posted Monday, April 6, 2009 6:07 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, June 29, 2010 4:31 AM
Points: 10, Visits: 66
Hi All,

I want to generate an email from my database. I have tried it lot of time by reading a lot of forums. But I still unable to generate the email....

I want to generate the email by using windows authentication......

Please help me and tell me the requirement to generate the email from database.

Thanks in advance.
Post #690923
Posted Monday, April 6, 2009 6:27 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, August 24, 2012 8:11 AM
Points: 1,097, Visits: 2,157
Kailash Mishra (4/6/2009)
Hi All,

I want to generate an email from my database. I have tried it lot of time by reading a lot of forums. But I still unable to generate the email....

I want to generate the email by using windows authentication......

Please help me and tell me the requirement to generate the email from database.

Thanks in advance.


Are you trying to set up Database mail here? What problem you have? how did you confirm that its not working?

Post #690941
Posted Monday, April 6, 2009 6:41 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, April 8, 2014 3:55 AM
Points: 28, Visits: 82
Have you tried using the xp_smtp_sendmail in master? If not i'll send you an example
Post #690952
Posted Monday, April 6, 2009 6:51 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, August 24, 2012 8:11 AM
Points: 1,097, Visits: 2,157
ksparke (4/6/2009)
Have you tried using the xp_smtp_sendmail in master? If not i'll send you an example


Nope
Post #690959
Posted Monday, April 6, 2009 7:10 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, April 8, 2014 3:55 AM
Points: 28, Visits: 82
Check master DB for the XP_SMTP_SENDMAIL extended stored proc or download xpsmtp80.dll and add it as an extended stored proc

Create the proc below and send it @TO,@CC,@Subject,@Message
Make sure the @server variable is set to the mail server I.P

Create procedure sp_mail
@TO varchar(8000),
@CC varchar(8000),
@Subject varchar(500),
@Message varchar(8000)

as

declare @rc int
exec @rc = master.dbo.xp_smtp_sendmail
@FROM = N' ', --Your email add
@FROM_NAME = N' ', --Add name to address
@replyto = N'',
@TO = @TO,
@CC = @CC,
@BCC = N'',
@priority = N'NORMAL',
@subject =@Subject,
@type = N'text/plain',
@message =@Message,
@messagefile= N'',
@attachment = N'',
@attachments= N'',
@codepage = 0,
@timeout = 10000,
@server = ' ' --add mail server i.p here
Post #690975
Posted Monday, April 6, 2009 10:57 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, June 29, 2010 4:31 AM
Points: 10, Visits: 66
Thanks all,

I downloaded the XPSMTP80.DLL and added it in database. Now I able to generate the mail.

But I think that the dll file XPSMTP80 was made by some person with the scripting, which I downloaded from the www.sqldev.net.

But I am unable to understand how it works, because we can't see the code....

Can someone tell me...

Thanks to all.
Post #691676
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse