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

G

Guest

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 ???
 
R

RB

Shruti said:
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.
 
S

Suneel Marthi

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top