Click here to Skip to main content
15,891,708 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I don't know the correct format for email using textbox. because I am going to put a lot or recipients. I'm gonna call the textbox only
Posted

1 solution

There is no one correct format for that. Main messages can have different parts, each in its own "format": text, graphics, and more. One of the content types is HTML, but some use RTF (way too obsolete). After all processing, everything is represented and sent as a plain text, but parts of the text can be encoded to some plain-text representation, typically, using base64. For example, HTML is already the plain text, so base64 is not used.

You are talking about something unrelated, the UI. As far as mail is concerned, it's a matter of convenience. If you want the user to put all content types in a plain-text format and encode all the content types the way user wants, it will, in principle, perfectly work, but the user would not want to do all that. If you use, say, RichTextBox, it will help you to write user's content as RTF, but it would be too limited.

The best approach is the one provided by some base mail clients. It gives you some option for entering formatted and unformatted text and options for your main-part content type (usually HTML or plain text). It allows the user to add parts by exporting separate files and to specify content disposition for each. Content disposition will help to choose, for example, if a PNG image is represented with "save as" or as a part of document flow inside the mail content. This way, the user can use any external editors (the same way as one would use an image editor) to edit separate parts.

Please see:
http://en.wikipedia.org/wiki/Content_type[^],
http://en.wikipedia.org/wiki/MIME[^],
http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html[^] (pay attention for "content disposition"),
http://en.wikipedia.org/wiki/E-mail[^].

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900