Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to generate email from database( MS SQL SERVER 2000 or 2005)


How to generate email from database( MS SQL SERVER 2000 or 2005)

Author
Message
Kailash Mishra
Kailash Mishra
Grasshopper
Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)

Group: General Forum Members
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.
maechismo_8514
maechismo_8514
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1108 Visits: 2228
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?
ksparke
ksparke
SSC Rookie
SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)

Group: General Forum Members
Points: 34 Visits: 82
Have you tried using the xp_smtp_sendmail in master? If not i'll send you an example;-)
maechismo_8514
maechismo_8514
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1108 Visits: 2228
ksparke (4/6/2009)
Have you tried using the xp_smtp_sendmail in master? If not i'll send you an example;-)


Nope
ksparke
ksparke
SSC Rookie
SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)

Group: General Forum Members
Points: 34 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
Kailash Mishra
Kailash Mishra
Grasshopper
Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)

Group: General Forum Members
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search