Hi guru's
Ok here is the problem(and a weird one at that) When I try to
start the xp_startmail it get the cmc error.(I have read all the documents
on this issue) I am able to send and receive using the NT mailbox and
profile I have setup. Now when I use the xpserver -SSERVERNAME_XP at a
command prompt and then use the xp_startmail in isql it works for all of my
batch emails and single emails except one script(see below) I have logged a
ticket with Sybase on the issue but was wondering if anyone out there had an
idea. Any suggestions would be most appreciative. Thanks in advance.
John

script that gives cmc error after starting the xpserver -SSERVERNAME_XP. The
script checks the date for a product and sends an email to the client
warning them that the product will be removed from the products available.

execute xp_startmail "Banter", "passwd"
go

declare cursor_item cursor for
select ITEM_TITLE, NAME_ID
from MAIN_ITEM_TABLE_1
where datediff(dd, DATE, getdate()) = 13
for update
go
open cursor_item
go
declare @c int, @nameid numeric, @title varchar(20), @email varchar(70),
@name varchar(20)
while @@sqlstatus = 0
begin
fetch cursor_item into @title, @nameid
update MAIN_ITEM_TABLE_1 set DISCONTINUED = 1

select @name = NAME_FNAME
from NAME_TABLE
where NAME_ID = @nameid
select @email = NAME_EMAIL
from NAME_TABLE
where NAME_ID = @nameid
select @name = rtrim (@name)
select @email = rtrim (@email)
select @title = rtrim(@title)
execute xp_sendmail @recipient = @name,
@subject = @title,
@message = "message"
select @email = space(70)
select @name = space(20)
select @title = space(20)
end
close cursor_item
go
execute xp_stopmail
go