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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Error in executing EXEC master.dbo.xp_send query

Author  Topic 

vanisa
Starting Member

10 Posts

Posted - 2009-07-13 : 03:21:32
Hi frnds,

I have to configure SQL Mail server to send mail.
Iam using POP3 server.I have made all my default settings like my default profile of the outlook and MSSQL server account name to be the same.

When i run my SQL query,
EXEC master.dbo.xp_sendmail
@recipients = 'sqladmin@xxxx.co.in',
@subject = 'Report',
@message = 'view'

Am getting this following error,Please help me out as soon as possible

Server: Msg 18025, Level 16, State 1, Line 0
xp_sendmail: failed with mail error 0x80004005

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2009-07-13 : 04:29:41
Are you using SQL 2000 or SQL 2005? If 2005, use DBMail instead.

If you are on 2000, do you have the Outlook client installed on the server?

Also, you need to allow the firewall to re-route the mail and allow SQL to alias, I can't remember what exactly to do with this, but speak to your network admin and he will be able to help. If you are working from home, you may need to sort it yourself. If I remeber, I will add to this post.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-07-13 : 04:47:57
If you are using attachments, please make sure that the account used for SQL Server Agent has access to the temp directory on the databas server.



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

vanisa
Starting Member

10 Posts

Posted - 2009-07-13 : 05:16:09
Thanks
Am using SQL 2000.Apart from this firewall setting do we have to change anything in setting wise??

My Sql Profile name:sqladmin
My accunt name in SQL server Agent :sqladmin
Mail profile name:sqladmin
E-mail setting is :sqsladmin@xxxx.co.in

what else to take care

quote:
Originally posted by RickD

Are you using SQL 2000 or SQL 2005? If 2005, use DBMail instead.

If you are on 2000, do you have the Outlook client installed on the server?

Also, you need to allow the firewall to re-route the mail and allow SQL to alias, I can't remember what exactly to do with this, but speak to your network admin and he will be able to help. If you are working from home, you may need to sort it yourself. If I remeber, I will add to this post.

Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2009-07-13 : 05:20:43
No, once set, run xp_stopmail and xp_startmail to check it is running ok, then all should be fine.
Go to Top of Page

vanisa
Starting Member

10 Posts

Posted - 2009-07-13 : 05:36:32
while executing this statement
exec master..xp_startmail

The output is:
SQL Mail session started.



quote:
Originally posted by RickD

No, once set, run xp_stopmail and xp_startmail to check it is running ok, then all should be fine.

Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2009-07-13 : 06:04:46
ok, do you get a mail session stopped if you run xp_stopmail?

Also, have you restarted your SQL service since making the changes to the mail profile? I think you at least need to do SQL Agent if I remember correctly (A while since i've done this on SQL 2000).
Go to Top of Page

vanisa
Starting Member

10 Posts

Posted - 2009-07-13 : 06:48:31
ya it is working fine with xp_stopmail too.
but still the error persist.


quote:
Originally posted by RickD

ok, do you get a mail session stopped if you run xp_stopmail?

Also, have you restarted your SQL service since making the changes to the mail profile? I think you at least need to do SQL Agent if I remember correctly (A while since i've done this on SQL 2000).

Go to Top of Page
   

- Advertisement -