Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6697787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:30:06+00:00 2026-05-26T06:30:06+00:00

Say I have an email class that has the following properties: public string From

  • 0

Say I have an email class that has the following properties:

public string From { get; set; }
public string To { get; set; }
public string Subject { get; set; }
public string Body { get; set; }
public Dictionary<string, byte[]> Attachments { get; set; }

I need to calculate the size of the email and if it is less than 10MB email it otherwise send the content as a fax (to prevent it being bounced from its destination).

I can calculate the size of attachments relatively easily.

Is there an accurate way to calculate the entire email size? I’m guessing I’ll need to add the size of the strings as well as any header information that will be appended?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:30:07+00:00Added an answer on May 26, 2026 at 6:30 am

    You cannot accurate know the size of the header. Since all servers that pass the mail to the next server might add some data to the header. This can range from one simple line, to the complete score of the spam scanning.

    So you will always get it wrong a few bytes.

    As for the size of the attachments: They are encoded, so the nr of bytes is not the actual size taken. If you convert them to Base64 and take the length of that string, that’s about the size they will take in the email (without attachment header, depending on the attachment name). An estimate is nr of bytes * 1.33.

    You can get a good clue, if the mail approaches 10 MB, but when the final and received mail is exactly 10 MB is not known.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have the following: $query = SELECT user_id,email,password, roles.role_id,role_name FROM users JOIN roles
Say I have the following generic class: public class Foo<T extends Bar> { //
Say i have the following two classes: public class User { public int ID
I have the following code that is part of my email class that I
I want to throw an exception to say that we have an invalid email
Lets say have this immutable record type: public class Record { public Record(int x,
Say I have the following model: class Person(models.Model): street_address = models.CharField(max_length=50, blank=True) suburb =
Let's say I have a user class setup with validation like this: [MetadataType(typeof(ssUserMetaData))] public
i have the following classes: //Product class public class Product { @Id @GeneratedValue private
Let's say I have a Company that has many Employees and each Employee can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.