sp_send_dbmail not working

  • for what seems like no reason we have stopped receiving mails from one of the servers.

    the error message in SQLAGENT.out :-

    Unable to start mail session (reason: No mail profile defined)

    I have a profile (actually I now have 2 trying to debug this), database mail is configured.

    No messages in ERRORLOG or database mail log.

    SQL Agent has been restarted and still nothing.

    I have tried sending an email using "Test Database Mail" option and running

    exec msdb.dbo.sp_send_dbmail

    @profile_name = 'TestEmail',

    @recipients = ' ',

    @subject = 'What the ghostie said',

    @body = 'BOO!'

    I know it is going to be something acutely obvious what is wrong but I cannot see it!

    I would very much appreciate anyones input!

  • think your agent service user does not have the right permissions to use dbmail try making a profile public to confirm that

  • I checked and the profile has the public box ticked, it just is not the default profile.

    I have another profile that also has the public box ticked and is default. Mail does not work from that either.

    Thank you for your interest and help!

  • As I said in my opening gambit, it is going to be something simple and oh boy it was!

    After some painful mail queue investigation I stopped and started Database Mail and eh voila email is now working!

    Next time ignore all the messages in log files and event viewer.........

    :w00t:

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply