By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,945 Members | 1,328 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,945 IT Pros & Developers. It's quick & easy.

How to retain spaces in Outlook Mail body through vb.net code

P: n/a
I am developing an application in vb.net 2005 to send email via outlook.
The mail body contains key - value pairs like

Account Number : 232323
CRS Number : 872732
Name : John

the problem is that this alignment is not retained when the mail is sent
through outlook although i"ve used it in code(using tab chars and padright).
The spaces are not retained,so the colons do not come ina line.

Is there a solution to this problem ???
Sep 20 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
RB
Shruti Deshpande wrote:
I am developing an application in vb.net 2005 to send email via outlook.
The mail body contains key - value pairs like

Account Number : 232323
CRS Number : 872732
Name : John

the problem is that this alignment is not retained when the mail is sent
through outlook although i"ve used it in code(using tab chars and padright).
The spaces are not retained,so the colons do not come ina line.

Is there a solution to this problem ???
You could change it so that it uses a HTML table instead of tabs/spaces.

For example, your email body might look like:

<table>
<tr>
<td>Account Number</td>
<td>232323</td>
</tr>
<tr>
<td>CRS Number</td>
<td>872732</td>
</tr>
<tr>
<td>Name</td>
<td>John</td>
</tr>
</table>

You might have to change your email sending code to specify that you are
sending a HTML email, rather than plain text.

Cheers.

RB.
Sep 20 '07 #2

P: n/a
Hi RB,

I am a novice in VB, could you post the code for generating the email in HTML.

Reason, I ask is I have a similar requirement wherein I need to retain the text format like - Bold, Italics etc.. when invoking Outlook from VB.

Thanks

Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.