I am trying to have my script calculate the maximum message size that will fit into an email sent from a SL object to an external email address. The wiki says the following:
"The entire message (including the address, subject and other miscellaneous fields) can't be longer than 4096 bytes combined."
"The 4096 byte size limit includes the subject line and automatically added text. The practical maximum body size is approximately 3600 bytes".
Its not clear what is meant by "other miscellaneous fields". Also, I would like to calculate the exact maximum body size, not the approximate practical size.
So I need to figure out how many bytes to subtract from 4096 to account for the address, subject and automatically added text, so I know how much room I have available for my actual message body. I know how to find the variable length of the address and subject strings as well as the automatic message header lines (e.g. Object-Name, Region and Local-Position) and associated \n's. I even accounted for the expansion of \n to \r\n.
The problem is that the llEmail call fails with several hundred less message characters than the above calculation indicates it should. So there must be more hidden header or other overhead bytes than the wiki implies.
Does anyone have a (verified) formula or method for calculating the maximum number of message characters that can be put into an email?
Thanks,
Fred