MAPI Attachment Question (OpenInsight)
At 21 JAN 2000 08:24:21PM Debbie Cornett wrote:
I am having a very strange problem when EMAILing with attachments using MAPI from OI. We have been doing this successfully for quite some time. We have discovered that if we have an EMAIL message with Text Marks in it, and we swap them to CRLFs, and we have an attachment, we get a OIMAPI02 General Failure message. If we do not include the attachment, it works fine. If we swap the text marks with
anything other than CRLF, it works fine. We just need it to work with the CRLFs and an attachment. Anyone seen anything like this before? Also, is there any way to get a better error message than OIMAPI02? It doesn't really tell you much. Thanks!
At 22 JAN 2000 08:59AM Debbie Cornett wrote:
Wow, this was a hard one to track down. I found that if my email text ended with a CRLF, the LEN command calculated the length of the text 1 short. Since the length is one of the parameters passed using MAPI, the MAPI02 General Error message occured. Stripping off any trailing CRLF characters does the trick. I have two questions, 1 - Has anyone else noticed this flaw with the LEN command, and 2 - Is there any way to get more meaningful messages from OIPI. General Failure is not real helpful.
At 24 JAN 2000 05:27AM Oystein Reigem wrote:
Debbie,
…the LEN command calculated the length of the text 1 short… …Has anyone else noticed this flaw with the LEN command…
Never. And I do it all the time. OI 3.61 and earlier.
Is there any way to get more meaningful messages from OIPI. General Failure is not real helpful.
When do you get General Failure? Doesn't OIPI return an error code (-1, -2, … -17) that you can translate into a meaningful text?
- Oystein -
At 24 JAN 2000 09:03AM Debbie Cornett wrote:
If there are error codes returned from the General Error, I would love to know what they are. It is very possible that I missed them somewhere in the documentation.
At 24 JAN 2000 09:28AM Oystein Reigem wrote:
Debbie,
Do you mean the Windows error message "General Protection Error"? If you get that when you run OIPI you should perhaps ask the author - Tony Splaver.
But if you mean an error code returned from one of your Get_Printer or Set_Printer calls, those error codes are documented in OIPI.HLP - Advanced Topics - Errors. In addition there are a couple of other errors I can tell you about.
- Oystein -
At 24 JAN 2000 03:44PM Debbie Cornett wrote:
Sorry, I have probably not been clear. I am having a problem with MAPI (Email) not OIPI. If the length of the text message being sent (which is calculated incorrectly by LEN if it ends in CRLF)is wrong, you get a MAPI02 General Failure message. How can I get better error messages out of MAPI?
At 25 JAN 2000 03:54AM Oystein Reigem wrote:
Debbie,
I know nothing about MAPI, I'm afraid.
And as I said I've never had a problem with Len(), with or without CR LFs. Are you really certain Len() is wrong? If I got a wrong result from Len() I would first suspect my own programming.
- Oystein -
At 25 JAN 2000 08:47AM Debbie Cornett wrote:
It may not have been the LEN command, I did some testing of the Len command by itself. It appeared to work just fine. When I was looking at the debugger and saw the offset at the left bottom of the screen, I was thinking it referred ot the length, not the offset from the first character. In any case, it does not work to have the text string passed to MAPI end with CRLF if you have an attachment. If you strip all CRLF stuff off of the end before you use the LEN command, the MAPI stuff will work, otherwise you get the GENERAL OIMAPI02 error. This is only a problem if you have an attachment.