Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- EXECUTE msdb.dbo.sysmail_add_account_sp
- @account_name = 'DBMailAccount',
- @email_address = 'test@test.com',
- @replyto_address = 'noreply@test.com',
- @display_name = 'SQL Server Agent Automated Mailer',
- @mailserver_name = 'smtp.test.com',
- @port = 587,
- @username = 'user@test.com',
- @password = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
- EXECUTE msdb.dbo.sysmail_add_profile_sp
- @profile_name = 'DBMailProfile';
- EXECUTE msdb.dbo.sysmail_add_profileaccount_sp
- @profile_name = 'DBMailProfile',
- @account_name = 'DBMailAccount',
- @sequence_number = 1;
- /* send test email */
- EXEC msdb.dbo.sp_send_dbmail
- @recipients = 'user@test.com',
- @body= 'Test Email Body',
- @subject = 'Test Email Subject',
- @profile_name = 'DBMailProfile';
- SELECT * FROM sysmail_allitems;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement