MailMessage default font and size

Is there a way to control the body font and font size used in MailMessage with plain text?
I don't need to do any fancy HTML formatting (I do make columns as the output) .
I just want to set the entire body to a specific font and size?

Is this possible, how can it be done?
LVL 2
alkabelloAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ukerandiCommented:
you can use like that
 Dim objMM As New MailMessage
        Dim smtpClient As New SmtpClient("localhost")

objMM.Body = "<span style=""font-family:Arial;font-size: 10pt;"">txtmsg.Text &"</span>"
0
alkabelloAuthor Commented:
I believe this is a HTML tag.

I'm trying to use Plain Text...

Also, I'm using Visual Studio'd C#, and the above code generates errors.
0
TommySzalapskiCommented:
If it is plain text, then no formatting information is sent, just the plain text (as the name suggests). There is no possible way to control how plain text is formatted to the person you send it to.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

TommySzalapskiCommented:
If you want to format it, use the HTMLBody field, not the body field.

MailMessage msg = new MailMessage;
msg.HTMLBody = "<font ...etc>text</font>"

Something like that.
0
Navneet.Net Full Stack DeveloperCommented:
HI!

This is done only with HTML Type like :
<font color="red">Some text!</font>

Or
Or you could use CSS:
<h3 style="color: #FF0000;">Some text!</h3>


If you are sending plain text email, there's no way to format your body.

For Sending Email
Use Link
http://www.dijksterhuis.org/using-csharp-to-send-an-e-mail-through-smtp/


Thanks!
0
DesignbyonyxCommented:
Worth noting that people intentionally receive plain text emails because they do not wish to see formatted emails. They just want to read text and move on.  Formatted messages may be perceived as sort of "spammish".

Also worth noting plain text emails cannot be formatted by using tabs, spaces, etc. as an attempt to line things up  (such as "columns" as you suggested in your comment):

all email clients use different fonts and font-sizes

users configure system-level and application-level fonts differently

every font face has a different letter width, letter spacing, line height, etc.


0
TommySzalapskiCommented:
The correct answer of "No, it cannot be done" was first given here http:#a37318248
0
DesignbyonyxCommented:
I agree with @TommySzalapski
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.