title: sql server sp_send_dbmail
body: <p>I am using SQL Server's <code>sp_send_dbmail</code> stored procedure to send mail via the database.</p>
  
  <p>But when I execute that procedure it's shutting down the db mail procedure. I tried to start it again by <code>sysmail_start_sp</code>. But it's again shutting down in 7-8 seconds.</p>
  
  <p>I tried with the code below:</p>
  
  <pre><code>EXEC msdb..sp_send_dbmail @profile_name = 'Test',
  @recipients = 'abc@gmail.com',
  @subject = 'test mail',
  @body_format = 'HTML',
  @body = 'test mail',
  @from_address = 'xyz@yahoo.com'
  </code></pre>
  
  <p>When I tried to check the error log I found the below error:</p>
  
  <blockquote>
    <p>Message:</p>
    
    <p>The read on the database failed. Reason: The error description is
    'Whitespace is not allowed at this location.'.Data:
    System.Collections.ListDictionaryInternalTargetSite:
    Microsoft.SqlServer.Management.SqlIMail.Server.Objects.QueueItem
    GetQueueItemFromCommand(System.Data.SqlClient.SqlCommand)HelpLink:
    NULLSource: DatabaseMailEngineStackTrace
    Information===================</p>
  </blockquote>
  
  <p>Also when I checked sql email log history I found this error:</p>
  
  <blockquote>
    <p>Mail not queued. Database Mail is stopped. Use sysmail_start_sp to start Database 
    Mail.</p>
  </blockquote>