473,805 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple string question

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

Nov 18 '05 #1
2 1106
use a carriage return, it is vbCrLf in VB

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

"Ammar" <am**********@c omhem.se> wrote in message
news:sz******** **********@news b.telia.net...
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

Nov 18 '05 #2
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
"Ammar" <am**********@c omhem.se> wrote in message
news:sz******** **********@news b.telia.net...
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

Nov 18 '05 #3

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

Similar topics

1
1789
by: Scott | last post by:
The following is the XML I have to work with. Below is the question <Table0> <CaseID>102114</CaseID> <CaseNumber>1</CaseNumber> <DateOpened>2005-06-14T07:26:00.0000000-05:00</DateOpened> <OnCallPerson /> <CallType>Exposure</CallType> <ExposureReason>General</ExposureReason> <OtherExposureReason>Unintentional</OtherExposureReason> <ClientName>Test Client</ClientName>
2
5031
by: Raskolnikow | last post by:
Hi! I have a very simple problem with itoa() or the localtime(...). Sorry, if it is too simple, I don't have a proper example. Please have a look at the comments. struct tm *systime; time_t currentTime; char day; char month;
51
8300
by: Alan | last post by:
hi all, I want to define a constant length string, say 4 then in a function at some time, I want to set the string to a constant value, say a below is my code but it fails what is the correct code? many thx!
1
1551
by: Brian Henry | last post by:
Hello, I was tring to learn socket's (being i never used them before) and have a simple question. I want to create a listner that will get any data recieved and print it out. I've been able to get it to recieve only one line of data, but the next one i send to it wont be printed like the 1st one. I had a listner running in a thread, does anyone have a simple listner code example that would show how to have a tcplistner thread running...
4
118819
by: dba_222 | last post by:
Dear Experts, Ok, I hate to ask such a seemingly dumb question, but I've already spent far too much time on this. More that I would care to admit. In Sql server, how do I simply change a character into a number?????? In Oracle, it is:
27
2863
by: Paulo da Silva | last post by:
Hi! I was told in this NG that string is obsolet. I should use str methods. So, how do I join a list of strings delimited by a given char, let's say ','? Old way:
4
2629
by: SM | last post by:
Hello, I have a simple question, but can't find the answer. I have a string that contains a path to a file I want to add another string to the end of that string So, if i have : path = document/disco/album/hello.doc i want it to become : document/disco/album/hello_large.xls
30
3554
by: galiorenye | last post by:
Hi, Given this code: A** ppA = new A*; A *pA = NULL; for(int i = 0; i < 10; ++i) { pA = ppA; //do something with pA
10
2142
by: Phillip Taylor | last post by:
Hi guys, I'm looking to develop a simple web service in VB.NET but I'm having some trivial issues. In Visual Studio I create a web services project and change the asmx.vb file to this: Imports System.Web.Services Imports System.Web.Services.Protocols Imports System.ComponentModel <System.Web.Services.WebService(Namespace:="http:// wwwpreview.#deleted#.co.uk/~ptaylor/Customer.wsdl")_
17
5830
by: Chris M. Thomasson | last post by:
I use the following technique in all of my C++ projects; here is the example code with error checking omitted for brevity: _________________________________________________________________ /* Simple Thread Object ______________________________________________________________*/ #include <pthread.h> extern "C" void* thread_entry(void*);
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10359
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10364
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9182
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6875
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5541
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4317
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.