Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
BendJoe
Posting Yak Master
128 Posts |
Posted - 2011-10-24 : 12:12:44
|
Hi,I was trying(for the first time) to set up database mail for sending emails after a successful job execution. When I try to sent a test mail the log message is like this."The mail could not be sent to the reciepients because of the mail server failure.(Sending mail using Account 1(date time). Exception Message:Cannot send mails to mail server.(Mailbox unavailable.The server response was:5.7.1 Unable to relay for xxxx@gmail.com)".How can I fix this issue.Thanks |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
BendJoe
Posting Yak Master
128 Posts |
|
skybvi
Posting Yak Master
193 Posts |
Posted - 2011-10-24 : 15:00:32
|
YOu can put all the code of execution in a SP and then exec the sp from a job with a schedule.EXEC msdb.dbo.sp_send_dbmail http://syntaxhelp.com/SQLSERVER/dbmailin above link, you can seesending database mail partRegards,SushantDBAWest Indies |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
Cindyaz
Yak Posting Veteran
73 Posts |
Posted - 2011-10-25 : 04:49:42
|
You can also send formatted output of the t-sql in HTML format (if you need to).see this link - [url]http://www.sqlservercentral.com/blogs/robert_davis/archive/2010/06/15/Building-HTML-Emails-With-SQL-Server-and-XML.aspx [/url] |
|
|
|
|
|