smtp - How to send e-mail from SQL Server? -
i have configured database mail – send email ...create 1 account also... used below query
exec msdb.dbo.sysmail_add_profile_sp @profile_name = 'sql 2008 profile', @description = 'used general-purpose emailing.' the second script creates new smtp account:
exec msdb.dbo.sysmail_add_account_sp @account_name = 'mailacct1', @description = 'smtp account.', @email_address = 'jojin127@gmail.com', @display_name = 'mail account', @mailserver_name = 'smtp.gmail.com' ; the third script associates new account new profile:
exec msdb.dbo.sysmail_add_profileaccount_sp @profile_name = 'sql 2008 profile', @account_name = 'mailacct1', @sequence_number =1; exec msdb.dbo.sysmail_add_principalprofile_sp @profile_name = 'sql 2008 profile', @principal_name = 'public', @is_default = 0 ; exec msdb.dbo.sysmail_configure_sp 'accountretrydelay', 1200 after go sent test mail... after write address getting error like
your test email has has been queued processing.depending on network speed , backlog of smtp server.it may take several minutes before email delivered receipt
please me out...
one more sent test mail asking 1 address in there need written email or servername
you should use sql server's built-in mailer. after wizard set up, sending mail trivial:
use msdb go exec sp_send_dbmail @profile_name='pinalprofile', @recipients='foo@bar.com', @subject='hello world', @body='hello alien world, ours, come in peace.'
Comments
Post a Comment