In the following example, when a message is received that contains a reply-to-address, a reply message is created and sent
containing the message ID in the in-reply-to-id:
begin
declare @msgid varchar(128);
declare @rmsgid varchar(128);
declare @replyaddr varchar(128);
set @msgid = ml_qa_getmessage( 'myaddress' );
set @replyaddr = ml_qa_getreplyaddress( @msgid );
if @replyaddr is not null then
set @rmsgid = ml_qa_createmessage();
call ml_qa_settextcontent( @rmsgid, 'message received' );
call ml_qa_setinreplytoid( @rmsgid, @msgid );
call ml_qa_putmessage( @rmsgid, @replyaddr );
end if;
commit;
end