If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Unanswered: SQL Mail not functioning

I'm attempting to get SQL Mail configured so I can use xp_sendmail to send out database query results automatically.

We're doing this via 2 accounts, 1 account (call it sql) calls the MSSQL procedures. Another account(sqlmail) handles all the mailing. In the SQL Mail account screen, the outlook profile config'd does test OK, and mail can be sent and rec'd through outlook. When xp_sendmail is called, it returns the following error:

Originally posted by ms_sql_dba
try using xp_smtp_sendmail instead, unless you're planning to receive and process mail as well.

I found a link to that procedure...however, i couldnt find any way for it to automatically attach the results of a query it runs. Would you recommend just using a different command line query function and then using that for the mailing? Or can anyone think of a different way to either a.) get xp_sendmail to work or b.) do the same thing (run a query then attach the results in CSV format to an email.

Originally posted by royxiao
Please confirm you start
SQL Server service and SQL Executive server with the account
can access the email.
If start with system account, the SQL mail can NOT use.

The SQL services are started with the SQL account, which has send/receive/use rights to the SQLMail account. While logged in using the SQL login, mail can be sent and rec'd via outlook(the profile set to be used for SQL Mail) using the SQLMail account.