Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Stored Procedure using xp_sendmail

Author  Topic 

saidev
Posting Yak Master

101 Posts

Posted - 2011-08-17 : 14:19:34
Hi Guys,

One of our application which was in VS2003 using vb.net/asp.net and Sql Server 2000. Forgot password link from the application calls one of the stored procedure which is using xp_sendmail. since our exchange server got upgraded it is not working. please see below my stored procedure code. can you guys give me some idea on how to proceed on this? Thanks.

CREATE PROCEDURE dbo.sp_sendpassword
@getUserName varchar(50)
AS

Declare @emailName varchar(50)

DECLARE @getCount int
DECLARE @messageText varchar(1000)
DECLARE @m varchar(1000)

select @getCount = (SELECT count(*) FROM tbluserrequests WHERE UserName = @getUserName)

if @getCount > 0
BEGIN

select @messageText= char(13) + MarketApplication' + char(13) + char(13)

select @m = (SELECT 'Password: ' + tbluserrequests .Password as PasswordString FROM tbluserrequests WHERE UserName = @getUserName)

select @emailName = (SELECT tbluserrequests .Email FROM tbluserrequests WHERE UserName = @getUserName)

select @messageText = @messageText + @m


exec master..xp_sendmail @recipients = @emailName,
@message =@messageText,
@subject = Marketing- Password'

END
GO

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-08-17 : 14:24:09
quote:

since our exchange server got upgraded it is not working.



You'll need to provide more detail. Is SQL Mail working? Are you able to send any emails with xp_sendmail? Are you getting an error? If so, please post it.

In summary, we need more information.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

saidev
Posting Yak Master

101 Posts

Posted - 2011-08-17 : 14:36:14
quote:
Originally posted by tkizer

quote:

since our exchange server got upgraded it is not working.



You'll need to provide more detail. Is SQL Mail working? Are you able to send any emails with xp_sendmail? Are you getting an error? If so, please post it.

In summary, we need more information.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog




Hi Tara Thanks for the reply.

When i execute this stored procedure in the query analyzer i am getting this message. please see below. Thanks.

xp_sendmail: failed with mail error 0x80040111
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-08-17 : 14:40:55
You'll need to get SQL Mail working again. Try rebuilding the profile.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

saidev
Posting Yak Master

101 Posts

Posted - 2011-08-17 : 14:45:23
[quote]Originally posted by tkizer

You'll need to get SQL Mail working again. Try rebuilding the profile.



Thanks for the reply Tara.

Can you please provide me the steps on how to rebuild the profile?
appreciate your help. Thank You.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-08-17 : 14:48:09
http://support.microsoft.com/kb/263556

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

saidev
Posting Yak Master

101 Posts

Posted - 2011-08-17 : 15:00:18
[quote]Originally posted by tkizer

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

Tara Kizer


Thanks for the link. quick question.

outlook 2000 is installed on the server. i will configure this server for the sql mail. my question is if the users have outlook 2007 or outlook 2010 does it still work? Thanks and appreciate your prompt response.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-08-17 : 15:07:15
It doesn't matter what the users have. SQL Mail runs from the server, not from the clients.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

saidev
Posting Yak Master

101 Posts

Posted - 2011-08-17 : 15:14:11
[quote]Originally posted by tkizer

It doesn't matter what the users have. SQL Mail runs from the server, not from the clients.

Tara Kizer


Thank you again..!
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-08-17 : 15:23:20
You're welcome, glad to help.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -