Determining the size of embedded images

I have been working on a LotusScript addition to the mail template to calculate the size of emails, and prevent oversized emails from being sent. There are a number of interesting threads about this, though I have gone my own way, since my client has certain special requirements. The process correctly calculates the size of the email if attachments are added, but embedded objects, such as images, are not included in the calculation.

I am simply using the doc.size property for the calculation, though I have also tried @DocLength. I am familiar with the issue of the lack of availability of rich text before a document is saved, and I am fairly sure this is the problem. An email is sent before it is saved, but even calling doc.save(true, true) before checking the size does not avoid the issue.

My question is simply, does anyone know of a way to get around this? Is there another way of determining the size of a document, before it is save?

My thanks in advance for your help.

Kind Regards

Paul Winchester

Subject: Administration tools

Paul,

I assume what you’re attempting to do is let the user know before they send the email that it’s too large. Otherwise you can use the standard sending controls for emails that prevent the email from being sent however this occurs after the user attempts to send the email. Look at Configuration doc for the server Router/SMTP, Restrictions.

Subject: Determining the size of embedded images

Roger, thanks for your quick response.

Yes, I am trying to prevent the mail sending at source, ie in the users mail file. This is necessary because the client wants to calculate the size based on the email sized multiplied by the number of recipients. I have a process that works, but it does not pick up the size of embedded objects.

We use the administrative restrictions on the server config doc as a last line of defense, but it does not take into account the combined size of an email sent to lots of recipients.