Simple string question

A

Ammar

Hi
a sily question!
I have decleared a string variable and then defined it by adding togather
other varibla lide this:
mailbody = " Name:" & Box1.Text & "Adress:" & Box2.Text & "Tel:" &
Box3.Text........

I wanted in fact to use this variable as a body of an e mail to be sent to
me, and i wanted the result to be something like this:

Name: whatever
Adress: whatever
Tel: whatever

But as it is so clear I am getting this in stead:

Name: whatever Adress: whatever Tel: whatever

I tried a trick to creat breakes between the variables by doing this:

mailbody = " Name:" & Box1.Text & "<br>" & "Adress:" & Box2.Text &"<br>" &
"Tel:" & Box3.Text........

when the mailbody is displayed in a web page, ex by assining it to a lable
as below

Label1.Text = mailbody

then the trick works fine of course, beacue the browser understands the HTML
tag <br>

BUT!!!!
when I use the SMTP service and use the mailbody variable as the body of the
mail and mail it to my yahoo mail this is what i get

Name: whatever <br> Adress: whatever <br> Tel: whatever

the yahoo e mail ignors the HTML tags, it trates the whole mailbody as a
text file naturally, so my question is:
what should i do to get a mailbody variable which looks like this:

Name: whatever
Adress: whatever
Tel: whatever

is there something i can use instead of the <br> in my example above? maybe
the ASCII code of return? or what?
thanks for the help
Ammar
 
R

Raterus

use a carriage return, it is vbCrLf in VB

myString = "first line" & vbCrLf & "second Line"
 
T

Tee

the trick you mentioned <br> only work when you send the mail as HTML ...

vbCrlf & vbNewline both can be used, but if you send it as HTML, this will
not function as what you like.


Tee
 

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

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,121
Latest member
LowellMcGu
Top