x
login about faq Site discussion (meta-askssc)

Database Mail error

Friends,

I configured a database mail. But when i try to send a e-mail using SP_SEND_DBMAIL and the error is showed in SYSMAIL_LOG table:

After error, the status of database mail is STOPPED.

Someone can help me?

1) 
Exception Information  
===================  
Exception Type: Microsoft.SqlServer.Management.SqlIMail.Server.Common.BaseException  
Message: The read on the database failed. 
Reason: The error description is 'Whitespace is not allowed at this location.'.  
Data: System.Collections.ListDictionaryInternal  
TargetSite: Microsoft.SqlServer.Management.SqlIMail.Server.Objects.QueueItem GetQueueItemFromCommand(System.Data.SqlClient.SqlCommand)  
HelpLink: NULL  
Source: DatabaseMailEngine    
StackTrace Information  
===================     
  at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.QueueDataReader.GetQueueItemFromCommand(SqlCommand c)     
  at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.QueueDataReader.GetQueueData(Int32 receiveTimeoutSec)     
  at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.DataAccessAdapter.GetDataFromQueue(Int32 receiveTimeoutSec)     
  at Microsoft.SqlServer.Management.SqlIMail.IMailProcess.QueueItemProcesser.GetDataFromQueue(DataAccessAdapter da, Int32 lifetimeMinimumSec)    


2) 
Exception Information  
===================  
Exception Type: System.Data.SqlClient.SqlException  
Errors: System.Data.SqlClient.SqlErrorCollection  
Class: 16  
LineNumber: 1  
Number: 6602  
Procedure: sp_xml_preparedocument  
Server: 10.67.4.10\SQL_2005  
State: 2  
Source: .Net SqlClient Data Provider  
ErrorCode: -2146232060  
Message: The error description is 'Whitespace is not allowed at this location.'.  
Data: System.Collections.ListDictionaryInternal  
TargetSite: Void OnError(System.Data.SqlClient.SqlException, Boolean)  
HelpLink: NULL    
StackTrace Information  
===================     
  at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)     
  at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)     
  at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)     
  at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)     
  at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()     
  at System.Data.SqlClient.SqlDataReader.get_MetaData()     
  at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)     
  at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)     
  at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)     
  at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)     
  at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)     
  at System.Data.SqlClient.SqlCommand.ExecuteReader()     
  at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.ConnectionManager.ExecuteReader(SqlCommand command)
more ▼

asked Apr 30 '10 at 02:12 PM in Default

Felipe gravatar image

Felipe
262 21 23 23

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

From the error, it looks like you have a space somewhere in either the To, CC or BCC fields of your email.

Can you post the call to sp_send_dbmail with parameters?

You may already have items in the queue that are causing this error. All emails can be removed from the system by using

EXECUTE msdb.dbo.sysmail_delete_mailitems_sp 
more ▼

answered Apr 30 '10 at 04:16 PM

Kev Riley gravatar image

Kev Riley ♦♦
46.1k 39 43 69

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x215
x28

asked: Apr 30 '10 at 02:12 PM

Seen: 1344 times

Last Updated: Apr 30 '10 at 04:21 PM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.