// Calculate the size (Title + content + nearby) of each mail and the total size of the inbox. // 1. Calculate the size of the mailbox; // 2. Calculate the title and content size. // 3. Calculate the total size of a single email. For example, [php] <? Php $ attach_size = 0; if ($ attachmentid) {// get the nearby size $ attach_data = attachdata ($ attachmentid); if ($ attach_data) {foreach ($ attach_dataas $ value) {$ attach_size + = $ value ['filesize'] ;}}// obtain the title and email content size $ email_content_size = 0; $ _ filename = "attachment/emailsizecalculate. tmp "; $ _ file = fopen ($ _ filename," wb "); fwrite ($ _ file, $ subject. $ content); fclose ($ _ file); if ($ _ temp = filesize ($ _ filename) {$ email_conten T_size = $ _ temp;} $ del_ret = @ unlink ($ _ filename); $ sum_size = $ attach_size * 1024 + $ email_content_size; // total mail size?>