473,408 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

how to format text for email message

Hello,

I need to send an automated email message from my application (vb2005) -
using system.net.mail. What I need to do to the message is to format the
text, like underlining, bolding, changing font colors. I can send the
message OK with the default font senttings. But how can I customize the
fonts/Text?

Thanks,
Rich
Aug 14 '06 #1
2 9243
So I am sending the mail via smtp using system.net.mail. It seems that there
is a property for the message body >Message.IsBodyHtml

If I state

Message.IsBodyHtml = True

then I can use HTML tags in the text and format the text that way. I just
tried it and it works:

Message = "<font size=2 color=redtesting </font>"

Any other suggestions greatly appreciated.
"Rich" wrote:
Hello,

I need to send an automated email message from my application (vb2005) -
using system.net.mail. What I need to do to the message is to format the
text, like underlining, bolding, changing font colors. I can send the
message OK with the default font senttings. But how can I customize the
fonts/Text?

Thanks,
Rich
Aug 14 '06 #2
Depending on who you are sending to. I would also recommend you look at the
AlternateView class.

http://msdn2.microsoft.com/en-us/lib...rnateview.aspx

Leave the MessageBody as plain text, then add an AlternateView that is HTML.

This way recipients that don't have "rich text" enabled (read HTML enabled)
in their email client will see the plain text version, while the rich
text/html enabled email clients will see the formatted version...
--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Rich" <Ri**@discussions.microsoft.comwrote in message
news:20**********************************@microsof t.com...
| So I am sending the mail via smtp using system.net.mail. It seems that
there
| is a property for the message body >Message.IsBodyHtml
|
| If I state
|
| Message.IsBodyHtml = True
|
| then I can use HTML tags in the text and format the text that way. I just
| tried it and it works:
|
| Message = "<font size=2 color=redtesting </font>"
|
| Any other suggestions greatly appreciated.
|
|
| "Rich" wrote:
|
| Hello,
| >
| I need to send an automated email message from my application (vb2005) -
| using system.net.mail. What I need to do to the message is to format
the
| text, like underlining, bolding, changing font colors. I can send the
| message OK with the default font senttings. But how can I customize the
| fonts/Text?
| >
| Thanks,
| Rich
Aug 14 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: JN | last post by:
Hello, I use an ASP mail object to send orders filled online to a recipient via an e-mail. I would like to know if it's possible to format the way the order looks in an e-mail? I tried the...
6
by: Danny Lesandrini | last post by:
I'm using an Access database to drive a web site and the colors of various table backgrounds are stored in Access. I want users of the Access database to be able to select colors for the site, but...
5
by: ramonred | last post by:
Hi All, this is the error: Input string was not in a correct format. this is the code I am trying to debug: <code> string sql = @" INSERT INTO (UserID, Login, Password, FirstName, LastName,...
0
by: Klaus Bonadt | last post by:
I would like to parse an email, which I receive from a pop3 account. While the subject and the sender's email address are probably easy to determine, the body seems to be more difficult because of...
8
by: touf | last post by:
Hi, I've a textbox bound to a field that contains an email address, I like to give it an email address format , so it will be highlighted and the user can click on it to open Outlook. How is it...
1
by: B-Dog | last post by:
I've built a form that I want to use to email some of the information off it to a few users which will include a link to a folder on our network. I'm trying to send it in html format but when the...
8
by: John Brock | last post by:
I am creating an Excel workbook using VB.NET, and have run into a problem. Excel at times insists on reformatting data that I enter into cells, e.g., converting "01234" to "1234", and this screws...
16
by: anya | last post by:
Hey, I have a certain problem and till now I didnt find an answer on the web. I want to send an email message with picture in it. I dont want to put it as attachment but make it in the body of...
14
by: Manish | last post by:
The project I am developing doesn't involves database. I want to parse the mailbox file (.mbx) and store the summary in the text file for fast retrieval and display of information in the Inbox...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.