Jun 28, 2001 #1 Dutchguy IS-IT--Management Joined Sep 4, 2002 Messages 10 Location NL Hi, Does anybody know how to figure out the bytesize of an email sent with cfmail? I coun't find a cffunction for it! Tnx
Hi, Does anybody know how to figure out the bytesize of an email sent with cfmail? I coun't find a cffunction for it! Tnx
Jun 29, 2001 #2 kristof Programmer Joined Jun 2, 2000 Messages 234 Location BE Hi dutchguy, Since a character is represent by a byte, all you need to know is the length of the message: Code: <cfset ln = Len(message)> <cfif ln gt 1024><cfset messageSize = Ceiling(ln / 1024) & " KB"><cfelse><cfset messageSize = ln & " Bytes"></cfif> <cfmail> #messageSize# </cfmail> So, ln will contain the byte value and messageSize will contain a string specifying it in KB or Bytes. Ofcourse, this is by far an exact value, but I guess it will do? Sure hope so! Kristof Upvote 0 Downvote
Hi dutchguy, Since a character is represent by a byte, all you need to know is the length of the message: Code: <cfset ln = Len(message)> <cfif ln gt 1024><cfset messageSize = Ceiling(ln / 1024) & " KB"><cfelse><cfset messageSize = ln & " Bytes"></cfif> <cfmail> #messageSize# </cfmail> So, ln will contain the byte value and messageSize will contain a string specifying it in KB or Bytes. Ofcourse, this is by far an exact value, but I guess it will do? Sure hope so! Kristof