Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exec sys.sp_configure 'show advanced options', 1;
- go
- reconfigure
- go
- exec sys.sp_configure 'Database Mail XPs', 1;
- go
- reconfigure
- go
- exec msdb.dbo.sysmail_add_account_sp
- @account_name = 'My Account4',
- @email_address = 'benjamin.buhagiar.a100465@mcast.edu.mt',
- @mailserver_name = 'smtp.outlook365.com',
- @port = 587,
- @enable_ssl = 1,
- @username = 'benjamin.buhagiar.a100465@mcast.edu.mt',
- @password = 'mcast371294';
- declare @profid int
- exec msdb.dbo.sysmail_add_profile_sp
- @profile_name = 'My Profile5',
- @description = 'This is the description',
- @profile_id = @profID OUTPUT;
- exec msdb.dbo.sysmail_add_profileaccount_sp
- @profile_id = @profid,
- @account_name = 'My Account4',
- @sequence_number = 1;
- exec msdb.dbo.sp_send_dbmail
- @profile_name = 'My Profile5',
- @recipients = 'benjamin.buhagiar.a100465@mcast.edu.mt',
- @subject = 'Test Email',
- @body = 'Test Email';
- select * from msdb.dbo.sysmail_mailitems;
- select * from msdb.dbo.sysmail_log;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement