SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Problem with xp_sendmail


Problem with xp_sendmail

Author
Message
vrkc
vrkc
SSC Eights!
SSC Eights! (989 reputation)SSC Eights! (989 reputation)SSC Eights! (989 reputation)SSC Eights! (989 reputation)SSC Eights! (989 reputation)SSC Eights! (989 reputation)SSC Eights! (989 reputation)SSC Eights! (989 reputation)

Group: General Forum Members
Points: 989 Visits: 72
Hi,

We are running SQL server 2000 SP3 on a windows 2000 server. When i am trying to run the below code in a job, i am getting the following error

Executed as user: DomainName\XXXX_SQLSRV. xp_sendmail: failed with mail error 0x80040111 [SQLSTATE 42000] (Error 18025). The step failed.

Please help me out with this error. The app team does not want to use xp_smtp_sendmail

CODE:

SET NOCOUNT ON
GO
declare @support_list varchar(100),
@sql_server varchar(20),
@mail_subject varchar(100),
@mail_message varchar(500)

-------------------------------------------------
-- Build support list
-------------------------------------------------
set @support_list = (select c1
from t_control
where control_type = 'SUPPORT_DAY')
set @support_list = @support_list +
(select c1
from .t_control
where control_type = 'SUPPORT_PGR_SERVER')


-------------------------------------------------
-- Server Info
-------------------------------------------------
set @sql_server = (select c1 from t_control where control_type = 'SQL SERVER')

-------------------------------------------------
set @mail_subject = @sql_server + ' Testing'
set @mail_message = @sql_server + ' Testing'

select @mail_subject
select @mail_message
select @support_list
EXEC master..xp_sendmail
@recipients = @support_list,
@subject = @mail_subject,
@message = @mail_message
lucky-80472
lucky-80472
SSCertifiable
SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)

Group: General Forum Members
Points: 7239 Visits: 842

Hello,

First things first,

1. Have you configured a mail profile with the domain account that the SQL Services are getting started?

2. Have you tested to send a test mail from T-SQL?

The reason for the error is that the mail profile is not configured with the account that it need to.

Hope this helps.

Thanks




Lucky
vrkc
vrkc
SSC Eights!
SSC Eights! (989 reputation)SSC Eights! (989 reputation)SSC Eights! (989 reputation)SSC Eights! (989 reputation)SSC Eights! (989 reputation)SSC Eights! (989 reputation)SSC Eights! (989 reputation)SSC Eights! (989 reputation)

Group: General Forum Members
Points: 989 Visits: 72
Hi Lucky,

Thank you for the reply. The mail profile is configured using the domail account. SQL server services and SQL server agent services are started using the same domain account.

When i tried to run the xp_sendmail from the query analyzer is am still getting
Server: Msg 18025, Level 16, State 1, Line 0
xp_sendmail: failed with mail error 0x80040111

i was simply trying to run this code

EXEC xp_sendmail @recipients = '5555555555@xxxx.com',
@message = 'The master database is full.',
@subject = 'Master Database Status'
Balmukund Lakhani-269523
Balmukund Lakhani-269523
SSCertifiable
SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)

Group: General Forum Members
Points: 6410 Visits: 367

327552 BUG: SQL Mail Only Works From One Instance at a Time
http://support.microsoft.com/default.aspx?scid=kb;EN-US;327552

I would give a shot to delete and recreate mail profile.


vrkc
vrkc
SSC Eights!
SSC Eights! (989 reputation)SSC Eights! (989 reputation)SSC Eights! (989 reputation)SSC Eights! (989 reputation)SSC Eights! (989 reputation)SSC Eights! (989 reputation)SSC Eights! (989 reputation)SSC Eights! (989 reputation)

Group: General Forum Members
Points: 989 Visits: 72
Thank you for the suggestion and the article..i will try to do that
Andrew C Thompson
Andrew C Thompson
Old Hand
Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)

Group: General Forum Members
Points: 318 Visits: 47
After modifying your mail profiles, you may need to issue "xp_stopmail" then "xp_startmail" from QA before the xp_sendmail will work properly.
maw74656
maw74656
SSC-Enthusiastic
SSC-Enthusiastic (154 reputation)SSC-Enthusiastic (154 reputation)SSC-Enthusiastic (154 reputation)SSC-Enthusiastic (154 reputation)SSC-Enthusiastic (154 reputation)SSC-Enthusiastic (154 reputation)SSC-Enthusiastic (154 reputation)SSC-Enthusiastic (154 reputation)

Group: General Forum Members
Points: 154 Visits: 93
We had a mailbox size issue in the account which was sending the emails. We had gotten a ton of "Unreachable recipient" messages. I deleted all those, then it worked fine.
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