Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Sending Emails

edited January 2007 in General
Hi
I recently upgraded from 7.04 to 10.04. I have started playing with the
email settings to allow users to email reports from the program.
I have noticed that in the ppSMTPMapi unit, the ErrorMessage is not getting
triggered for a "user abort". In the SendMail function, the ErrorMessage
procedure is only getting called when the result from MAPISendMail is > 1,
ie either not SUCCESS or USER ABORT.
The problem is that I want to know if the user has aborted the send
operation because there is actions I want to take if the email has been sent
(successful or otherwise).
The logic is as follows:
User Selects recipients to send report to
User print reports
Email dialog is shown allowing user to customise recipients, subject,
message ect
If user hits send, program performs certain actions
If user aborts send, program performs certain actions
If I change the following lines of code from:
---snippet-----
lcSendMail := MapiSendMail(FSessionHandle, Application.Handle, FMapiMessage,
liFlags, 0);
if (lcSendMail > 1) then
ErrorMessage(lcSendMail);
---end snippet-----
to
---snipptet---
lcSendMail := MapiSendMail(FSessionHandle, Application.Handle, FMapiMessage,
liFlags, 0);
if (lcSendMail > 0) then
ErrorMessage(lcSendMail);
---end snippet-----
what impact will this have.
Thanks
Dominic

Comments

  • edited January 2007
    Hi Dominic,

    Thanks for the feedback. The original version of this plugin displayed all
    errors in an error box which made the "User Abort" error annoying to see
    every time the user canceled an email. Now that we have implemented the
    OnEmailError event to handle the errors this is no longer necessary. I will
    have this changed for the next maintanence release. Changing this on your
    own should have not break anything.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.