Friday, March 30, 2012

it's very urgent regarding XP_SEND MAIL

Hi,
I have a problem in sending mail from sql server 2000 which is using
windows 2000 professional and outlook express
Iam pasting my code below
/
************************************************** ************************************************** ********
Create procedure Pub_SendingMail
as
declare
@.EmailAddTO varchar(30),
@.EmailSubject varchar(130),
@.EmailText varchar(255),
@.return int,
@.Counting int
@.
begin
/* SET value */
set @.return = 0
set @.Counting = 0
set @.EmailSubject = 'TEST EMAIL'
set @.EmailText = 'This is a test email'
set @.EmailAddTO = 'nagesh@.emids.com'
/* LOOP. If e-mail is sent, break loop; ELSE WAIT 10 seconds, and
then RETRY. */
WHILE 1=1
begin
set @.Counting = @.Counting + 1
exec @.return = master.dbo.xp_sendmail
@.recipients = @.EmailAddTO,
@.message = @.EmailText ,
@.subject = @.EmailSubject
@.attachments = 'c:\attachment.txt'
/* CHECK value, break if SUCCESS */
if @.return = 0
begin
print 'EMAIL SENT'
break
end
else
begin
/* Try 1 times */
if @.Counting = 1
break
print 'EMAIL FAILED, WAIT 10 SECONDS, TRY AGAIN'
/*000 hours, 00 minutes, and 10 seconds */
waitfor delay '000:00:03'
end
end
end
************************************************** ************************************************** *************/
and when iam executing
EXEC Pub_SendingMail
it is giving the following error
Server: Msg 18030, Level 16, State 1, Line 0
xp_sendmail: Either there is no default mail client or the current
mail client cannot fulfill the messaging request. Please run Microsoft
Outlook and set it as the default mail client.
but here i need to send mail not only to out look express but also
general mail servers
I would deeply appriciate if any body can help me about this issue
and send any modifications in the above code.And also how to configure
the Microsoft Outlook Express as the default mail client.
it is very very very very very urgent
Regards
prasad
You'll need to set up a MAPI mail profile for this to work. Alternatively
you could use the XPSMTP.DLL which is free
(http://www.sqldev.net/xp/xpsmtp.htm).
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .

No comments:

Post a Comment