[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1479
  • Last Modified:

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?
0
PsychoDazey
Asked:
PsychoDazey
  • 5
  • 4
  • 2
2 Solutions
 
Jim P.Commented:
Quick glance -- what account is the SQL Server and SQL Server Agent running under.  

Is it consistent from the SQL Server Configuration Manager and the Services Console?

xp_startmail Error Message Does Not Indicate Problem
http://support.microsoft.com/kb/292761
0
 
Eugene ZCommented:
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?
0
 
Eugene ZCommented:
..MSSQLServer Service should be configured to use a domain account rather than the system account in order for SQL Mail to function properly...

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
PsychoDazeyAuthor Commented:
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.
0
 
PsychoDazeyAuthor Commented:
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?

0
 
Eugene ZCommented:
there is new sp3 for sql server 2005...
http://www.microsoft.com/downloads/details.aspx?FamilyID=ae7387c3-348c-4faa-8ae5-949fdfbe59c4&displaylang=en


---
there are 2 ways to email from sql server 2005:
SQL Mail with Database Mail.
---
SQL MAIL
 (MAPI  based ) and if you upgraded from 2000 it is probably what you have

However the better (SMTP based) way is Database Mail
pls see the article below:

Setting up Database Mail for SQL 2005
http://www.mssqltips.com/tip.asp?tip=1100
0
 
PsychoDazeyAuthor Commented:
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?
0
 
Eugene ZCommented:
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 
0
 
PsychoDazeyAuthor Commented:
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!
0
 
PsychoDazeyAuthor Commented:
Thanks for the suggestions, splitting points for your input although they weren't my exact solution.
0
 
Jim P.Commented:
Glad to be of assistance. May all your days get brighter and brighter.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 5
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now