Hello,
has anybody an idea, how to modify CU 397 "Mail" in NAV 2.60 to create a return value, that display me, whether a mail was successfully send or not.
It would be extremly helpful for me to have control over the code execution, to react on the result of the mail send action.
Because sometimes our mailserver is busy and then the mail send is not successful, but my code continues as if it was successful.
Regards,
Rolf
0
Comments
an untested suggestion:
use return value type boolean
add an exit at the end of function "NeuMitteilung" with the sent parameter
...
MCP+I, MCSE NT, Navision MCT (2004,2005)
always returns "FALSE".
I think this is not designed to return the success-message for sending an Email.
it seems that the property msgsent is not set at all. Digging through the docs I found one of the reasons to be the msgindex, which has to be -1 for the outgoing buffer, nevertheless it does not work. It maybe related to the asynchronous transmission from the outlook client to the exchange server.
I verified that it is possible to catch all the outlook related errors when using the OCX outside Navision (as Navision doesn't support structured or global error handling). So it is possible to detect e.g. if the user canceled the sending request when using the interactive variant of the send method etc. In case everything is fine, the error code is 0.
I need to find a way to simulate the busy server to see whether this error is caught too. If so, I'll create an OCX-wrapper. Let me know whether you would like to test it.
MCP+I, MCSE NT, Navision MCT (2004,2005)
yes I would like to test, if you manage to create that wrapper.
By the way, we don't use Outlook or Exchange. We use a Mailsystem called "David".
a first version can be downloaded here http://www.todro.de/MapiWrapperForNavision.msi
I made it compatible to the properties and methods of Navision 3.70B's codeunit 397.
This is an extract from the codeunit:
Any feedback appreciated.
MCP+I, MCSE NT, Navision MCT (2004,2005)
thanks for the Tool.
I installed it an did some testing.
So far I found no problems and it works really good.
I have just on question:
What is the max. Characters that the following methods and properties can handle?
- ToName
- CCName
- Subject
- Body
- AttachFileName
- AddBodyText
I just integrated it into my application, and tomorrow I will give you more feedback, if your MAPI Wrapper is stable.
Thanks,
Rolf
max. strlen is actually 1024. As Navision 2.x supports a maximum length of 256(250) only, this might be a problem but only for properties maintained by the wrapper (ErrorDescription) and might cause an overflow when getting a longer error description. I will change the behaviour like this and create a new version:
a.) max. strlen for the check (and copy) can be set from Navision
b.) error description can be retrieved on a line-by-line basis with a max. length as defined with a.)
So far, I did not check explicitly the max. length MAPI accepts. This is an open task but nevertheless, any error will be reported in the error status so I do not see a problem here. The only thing is that the error might not be as "speaking" as it could be, but working with Navision we have arranged with this type of error messages
Regards,
Torsten
MCP+I, MCSE NT, Navision MCT (2004,2005)
We are running on NAV 4.0 SP2 on SQL 2005, but we use the functions from the 2.60 CU 397, because in 2.60 this CU was MAPI compatible, while the Version in 4.0 of this CU only works with Outlook.
So we don't underlie the restrictions of 2.60, but we are currently using the Mail CU from 2.60 because we don't use Outlook at the moment.
I'm using the tool now for two days in our productive environment, without any problems.
Just one more question:
Is it posible to have more than one attachment in an email with our tool?
Thanks again,
Rolf