tom muck wrote:

>>This will bomb on quite a few mailservers and mailclients. The RFC
>>dealing with mail (RFC 2822) says the following about line lengths:
>>
>>'  - Lines of characters in the body MUST be limited to 998 characters,
>>      and SHOULD be limited to 78 characters, excluding the CRLF.'
>>
> 
> I'll have to look into this.  You're probably right about some clients not
> being able to interpret the image here, but most "modern" clients will.  I
> think a simple loop to break up the data will work here.


I use this:

<cffile action="read" 
file="#request.AdvancedEmail.AttachmentArray[CurrentAttachment][1]#" 
variable="temp">
<cfscript>
temp = ToBase64(temp);
CurrentPosition = 78;
// Base64 encoded stuff has a maximum line length of 1000 characters 
(but 72 looks nice)
while (CurrentPosition LTE Len(temp))
{
        temp = Insert(CRLF,temp,CurrentPosition);
        CurrentPosition = CurrentPosition + 80;
}
</cfscript>

Jochem


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to