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.
ianjevansAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.