Results 1 to 11 of 11
  1. #1
    Join Date
    Feb 2012
    Posts
    188

    Unanswered: Email Never Sends Only Shows Mail Queued

    This is my syntax which looks valid to me, but the message will never send, can someone assist in getting the message to send?
    (@recipients & @from_address are junk here, but valid email addresses in my procedure)
    Code:
    exec msdb.dbo.sp_send_dbmail 
    	@profile_name = 'DatabaseMail', 
    	@recipients = 'loggedinuser@domain.com',
    	@body_format = 'HTML',
    	@from_address = 'SQLEmailAccount@domain.com',
    	@body = 'Test 12345',
    	@subject = 'Test Email From SQL Server';

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Check the log table to see if you are getting any errors:
    Code:
    select *
    From msdb..sysmail_log
    This table should log not only sent messages, but errors sent back by the SMTP server.

  3. #3
    Join Date
    Feb 2012
    Posts
    188
    The data in the column of [log_date] most recent entry is from 2015-04-11 17:02:36.037.

  4. #4
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    What do you get when you run the following in the msdb database?
    Code:
    sysmail_help_status_sp

  5. #5
    Join Date
    Feb 2012
    Posts
    188
    An error is thrown:
    Code:
    Msg 2812, Level 16, State 62, Line 1
    Could not find stored procedure 'sysmail_help_status_sp'.

  6. #6
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Are you sure you ran that in the msdb database?

  7. #7
    Join Date
    Feb 2012
    Posts
    188
    Click image for larger version. 

Name:	Capture.PNG 
Views:	1 
Size:	18.9 KB 
ID:	16462

    In my query window it shows I am using master as my database (unless I am terribly mis-understanding)

  8. #8
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by MCrowley View Post
    What do you get when you run the following in the msdb database?
    Code:
    sysmail_help_status_sp
    Just for the purist in me, let's formalize this as:
    Code:
    EXECUTE msdb..sysmail_help_status_sp
    and see what it returns.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  9. #9
    Join Date
    Feb 2012
    Posts
    188
    Quote Originally Posted by Pat Phelan View Post
    Just for the purist in me, let's formalize this as:
    Code:
    EXECUTE msdb..sysmail_help_status_sp
    and see what it returns.
    -PatP
    This syntax returns:
    Code:
    STARTED

  10. #10
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Well, things look to be running. What is in the outbound queue, then?

    Code:
    select *
    from msdb..externalmailqueue
    Ideally, this should be empty. I am betting that yours is not.

  11. #11
    Join Date
    Feb 2012
    Posts
    188
    Running the above syntax, returns no results.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •