This always works for me.
-- this configures the database mail on the server
exec sp_configure 'show advanced options', 1
reconfigure
exec sp_configure 'Database Mail XPs', 1
reconfigure
-- this sends mail
DECLARE @p_body as nvarchar(max), @p_subject...