Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1161
  • Last Modified:

SQL SERVER 2000 - xp_sendmail: Could not resolve recipient

All,



I am having trouble firing the following SP...

NOTE - this worked fine in SQL 6.5 but until an upgrade has'nt worked..

BEGIN
declare @mgname varchar(255)
declare @mgsubject varchar(255)
select  @mgsubject = ' '
select  @mgname = (select a.swextemailaddress from sw_person a, sw_hd_case b where b.swreportedby = a.swpersonid and b.swhdcaseid = @swhdcaseid)
declare @mgsubject1 varchar(255)
select  @mgsubject1 = 'Your Call logged with ABB has been closed - '+ convert(varchar(35),@swhdcaseid)
declare @mgemailquery varchar(255)
select @mgemailquery ='vantivtest..dtsp_email_getinfo_closed '+ convert(varchar(25),@swhdcaseid)
exec master..xp_sendmail @mgname,@mgsubject , @mgemailquery, @width=250,@separator=' ',@subject= @mgsubject1
END

GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

I recive the error - xp_sendmail: Could not resolve recipient

When i modify the 'select  @mgname = ' to contain a correct email address ( ie myname@hotmail.com ) it work fine...

Is there a known problem in SQL 2000. I do not want to hard code the email address into the SP..

cheers

Ian.
0
ianjevans
Asked:
ianjevans
  • 2
  • 2
1 Solution
 
Eugene ZCommented:
can you run :
--------------------------------------
declare @mgname varchar(255)
declare @mgsubject varchar(255)
select  @mgsubject = ' '
select  @mgname = (select a.swextemailaddress from sw_person a, sw_hd_case b where b.swreportedby = a.swpersonid and b.swhdcaseid = @swhdcaseid)
--------------------------
print @mgname

--And see what @mgname is ... first...
0
 
ianjevansAuthor Commented:

EugeneZ

Results from the Result window after placing the 'Print' line into the SP.....

ievans@deloitte.com.au                  
Server: Msg 18031, Level 16, State 1, Line 0
xp_sendmail: Could not resolve recipient

0
 
Eugene ZCommented:
TRY:
          ...RTRIM(LTRIM(a.swextemailaddress)) ...
0
 
ianjevansAuthor Commented:
EUGENEZ

All works fine...

Thanks for all your help ..

cheers

Ian

0
 
NitzosCommented:
Very time over, but now I stop my program at this problem.
I look in MS-Article KB315666
Microsoft confirme that it is a bug
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now