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
 problem with sql mail

Author  Topic 

bobz_0585
Yak Posting Veteran

55 Posts

Posted - 2009-12-09 : 10:21:10
hello all i was trying to send mail using sql ...i used the following stored procedure

declare @recipients nvarchar(50)
set @recipients='i.shoujaa@skyband.com.sa'
declare @message nvarchar(500)
set @message='test1'
--exec master..xp_stopmail
EXEC master..xp_sendmail
@recipients ,
@message ;
exec master..xp_stopmail

when i run the query with outlook running on the remote oc i get the following error
SQL Mail session started.
Msg 18025, Level 16, State 1, Line 0
xp_sendmail: failed with mail error 0x8004011d

now when i close it the everything goes as planned but the mail is never sent before i open outlook!!! how can i fix this issue? because it is not logical to have to open outlook every time the mail should be sent

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-12-09 : 11:09:03
You do not have your mail client configured properly. Check out Microsoft's article on how to configure SQL Mail, which can easily be found if you google it.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -