use master go sp_configure 'show advanced options',1 go reconfigure with override go sp_configure 'Database Mail XPs',1 --go --sp_configure 'SQL Mail XPs',0 go reconfigure go EXECUTE msdb.dbo.sysmail_add_account_sp @account_name = 'MyMailAccount2', @description = 'Mail account for Database Mail', @email_address = 'dilip.aim12@gmail.com', @display_name = 'MyAccount', @username='dilip.aim12@gmail.com', @password='*********', @mailserver_name = 'smtp.gmail.com' EXECUTE msdb.dbo.sysmail_add_profile_sp @profile_name = 'MyMailProfile2', @description = 'Profile used for database mail' EXECUTE msdb.dbo.sysmail_add_profileaccount_sp @profile_name = 'MyMailProfile2', @account_name = 'MyMailAccount2', @sequence_number = 1 EXECUTE msdb.dbo.sysmail_add_principalprofile_sp @profile_name = 'MyMailProfile2', @principal_name = 'public', @is_default = 1 declare @body1 varchar(100) set @body1 = 'Server :'+@@servername+ ' My First Database Email ' EXEC msdb.dbo.sp_send_dbmail @recipients='dilip.aim11@gmail.com', @subject = 'My Mail Test', @body = @body1, @body_format = 'HTML' ;
Mail queued.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)