Link to home
Start Free TrialLog in
Avatar of PsychoDazey
PsychoDazey

asked on

xp_startmail: failed with mail error 0x80040108

I am running sql server 2005 on windows server 2003.  I have some stored procedures that send e-mail notifications when they are run.  It will run fine, sometimes for days or even weeks, then it will suddenly fail.  The stored procedure uses the:
EXEC xp_stopmail
EXEC xp_startmail
method.  When it fails, it fails on the xp_startmail line and returns this error:
Msg 17925, Level 16, State 1, Line 0
xp_startmail: failed with mail error 0x80040108

I have to restart the sql server service and then it works fine again.  Just restarting the agent alone doesn't work.  Has anyone experienced this before?
ASKER CERTIFIED SOLUTION
Avatar of Jim P.
Jim P.
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of EugeneZ
you need  to post more info about you sql server 2005:
did you install fresh service pack for sql server 2005

SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')

more:
http://support.microsoft.com/kb/321185

----
How did you set you sql server mail ; as db mail or post sql server 2000 upgraded with MAPI?
..MSSQLServer Service should be configured to use a domain account rather than the system account in order for SQL Mail to function properly...

Avatar of PsychoDazey
PsychoDazey

ASKER

Thanks Eugene, it is configured to use a domain account.  It works fine for a period of time then it suddenly stops until I restart the service.  I dont know if one of the stored procs is erroring out and causing it to hiccup or what.
Here is the info you asked for:

9.00.3042.00 SP2 Standard Edition

I'm not sure what you mean by this:
How did you set you sql server mail ; as db mail or post sql server 2000 upgraded with MAPI?

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I had tried to set up database mail and ran into problems.  Even though I am using an account with domain permissions, it fails to send the test e-mail.  I had tried following the article you referenced.

Did you notice if the sp3 service pack addresses any mail issues?
what did you try to setup: Database Mail?
if 'yes' make sure SMTP server is visible from sql server and the SMTP server let you send emails from your sql server
and check if antivirus on sql server does not block port 25
try from command line of sql server: telnet yourSMTPserver 25
 
check
http://www.db-staff.com/index.php/microsoft-sql-server/90-configure-database-mail 
It turned out that this was caused by a disconnect between 2 exchange servers in different facilities.  Some of the recipients could not be resolved by name using exchange.  When that happened it would throw an error on the xp_sendmail task and it wouldn't work again until the service was restarted.  To avoid this issue I created a view into Active Directory and I get the actual e-mail address instead of trying to resolve the name in Outlook.  Not exactly elegant but the problem seems to have stopped!
Thanks for the suggestions, splitting points for your input although they weren't my exact solution.
Glad to be of assistance. May all your days get brighter and brighter.