Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bitesize

Status
Not open for further replies.

Dutchguy

IS-IT--Management
Sep 4, 2002
10
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 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) & &quot; KB&quot;><cfelse><cfset messageSize = ln & &quot; Bytes&quot;></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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top