Forum Discussion

NickA990's avatar
NickA990
Copper Contributor
Jun 14, 2021

SQL Mail config

I am trying to set up database mail using the instructions at https://techcommunity.microsoft.com/t5/azure-sql/sending-emails-in-azure-sql-managed-instance/ba-p/386235.

 

However, when trying to implement the first step...

EXECUTE msdb.dbo.sysmail_add_account_sp 
	@account_name = '[ACCOUNT NAME]',
	@description = '[DESCRIPTION]',
	@email_address = '[EMAIL ADDRESS]',
	@display_name = '[DISPLAY NAME]',
	@mailserver_name = '[MAILSERVER]' ,
	@username = '[USERNAME]',
	@password = '[PASSWORD]';

...I get the following error:

 

Any advice greately appreciated...

 

Thanks,

 

Nick

  • Hi NickA990 --

     

    What happens if you parse the command in Management Studio (the checkmark icon to the left of the Execute button)?  You can also parse the command using CTRL+F5.  Is an error returned.

     

    The message in your post appears to be intellisense encountering an issue finding the msdb database, not an actual query syntax issue. You might want to try disconnecting and reconnecting to the SQL Managed Instance.  Take care.

    • NickA990's avatar
      NickA990
      Copper Contributor

      Thanks for your reply. Turns out I was told we have a managed instance when we don't :facepalm:

       

      As I can't see any way of using any kind of DBMail in Azure SQL single database, I'm going to play with Logic Apps instead...

Resources