Hi all,
I am using mapi handler to send an email containing an EFT PDF notification to a list of vendors from the EFT Transfer module.
Obviously if one of the emails in the list is invalid I do not want the program to stop but instead email the user details of the record that was not sent.
However when the program reads the next record even though there is a valid address the ErrorStatus keeps coming up as an error and not 0. Has anyone encountered this before? :?:
IF EXISTS(TempFileName) THEN BEGIN
IF ISCLEAR(MapiHandler) THEN
CREATE(MapiHandler);
ErrorNo := 0;
MapiHandler.ToName := RecipientAddress;
MapiHandler.CCName := CCName;
MapiHandler.Subject := Subject;
IF Body <> '' THEN
MapiHandler.Body := Body;
MapiHandler.AttachFileName := TempFileName;
MapiHandler.OpenDialog := OpenDialog;
AdminAddress := USERID + Text012;
MailSent := MapiHandler.Send;
ErrorNo := MapiHandler.ErrorStatus;
IF ErrorNo <> 0 THEN BEGIN
Body := Text011 + ' ' + RecId;
MapiHandler.Body := Body;
MapiHandler.ToName := AdminAddress;
ErrorNo := 0;
MailSent := MapiHandler.Send;
ErrorNo := MapiHandler.ErrorStatus;
ErrorNo := 0;
END;
EXIT;
END;
0
Comments
I would try to recreate the object.
I added the Clear and the recreate and yes it works beautifully. thanks.