473,574 Members | 2,428 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

linebreaks in VBScript variables

I'm trying to format an email message. The message has line breaks in
it. How do I do this in VBScript?

Is there anything like a heredoc?

$msg = <<this_msg;

anything
you want
here

this_msg

Jeff
Jul 19 '05 #1
3 19884
Jeff Thies wrote on 07 aug 2003 in microsoft.publi c.inetserver.as p.general:
I'm trying to format an email message. The message has line breaks in
it. How do I do this in VBScript?


You cannot send an email message with asp vbs, you need an application.

So tell us your application.

=============== ======

Usually you send the body as a text string and start a new line with VbCrLf

mybody = "Hi Jeff," & VbCrLf
mybody = mybody & "This is body language." & VbCrLf
mybody = mybody & "yours truly," & VbCrLf
mybody = mybody & "etc." & VbCrLf
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #2
If the message format is plain text concatenate vbCrLf where you want
carriage return/line feeds.
If the message format is html, concatenate "<br>" where you want breaks.
sPlainTextMessa geBody = "Dear Sir," & vbCrLf & vbCrLf & "Here's a message."
sHTMLMessageBod y = "Dear Sir,<BR><BR>Her e's a message."

Ray at work
"Jeff Thies" <cy*******@spri ntmail.com> wrote in message
news:3F******** *******@sprintm ail.com...
I'm trying to format an email message. The message has line breaks in
it. How do I do this in VBScript?

Is there anything like a heredoc?

$msg = <<this_msg;

anything
you want
here

this_msg

Jeff

Jul 19 '05 #3
Thanks to all!

Comments below.

"Evertjan." wrote:

Jeff Thies wrote on 07 aug 2003 in microsoft.publi c.inetserver.as p.general:
I'm trying to format an email message. The message has line breaks in
it. How do I do this in VBScript?
You cannot send an email message with asp vbs, you need an application.

So tell us your application.


CDONTS
=============== ======

Usually you send the body as a text string and start a new line with VbCrLf

mybody = "Hi Jeff," & VbCrLf
mybody = mybody & "This is body language." & VbCrLf
Ah!

Is there an operator where you don't have to add to the variable

JScript woould be:

mybody = "a line"
mybody += "another line"

also, what does this do:

& _

Cheers,
Jeff
mybody = mybody & "yours truly," & VbCrLf
mybody = mybody & "etc." & VbCrLf

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Jul 19 '05 #4

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

Similar topics

5
2256
by: Mechphisto | last post by:
I'm using a textarea to insert some notes into a database. It's inserting the complete result into the mySQL table including the linebreaks...and not as a visible symbol but an actual linebreak. If I select the fireld in mySQL at a command prompt, the results take an inordinate amount of space from all the linebreaks. I tried nl2br() before...
7
72131
by: Jonas Daunoravicius | last post by:
The subject pretty much sums up what I need to do. Here is what I have so far, but still can't figure out how to get it working: <script language="javascript" type="text/javascript"> function fillForm() { // split the query string into pieces var qs = location.search.substr(location.search.indexOf("?")+1); qs = qs.split("&"); alert(qs);...
20
5957
by: Harag | last post by:
Hi All. I'm stating out doing some web developing. I was wondering which of the server side languages should I concentrate on and learn. I Know CSS, HTML, T-SQL I can look at the client javascript code and work out what it does but I can't really write it from scratch.
3
15167
by: Matt | last post by:
<% hour = Request("controlname") %> will yield the following error: Microsoft VBScript runtime (0x800A01F5) Illegal assignment: 'hour' However, if I declare hour, then it is fine. <% Dim hour hour = Request("controlname") %>
1
1991
by: alaa | last post by:
I have the following code in an ASP page but it does not seem to allow a JScript to access VBScript variables. But if a VBScript accesses a variable in declared in a JScript TAG then it seems to work. Can anyone help <SCRIPT LANGUAGE ="VBSCRIPT" RUNAT="SERVER" Dim tes test = 10 </SCRIPT><SCRIPT LANGUAGE ="JSCRIPT" RUNAT="SERVER" ...
2
2586
by: ChucRock | last post by:
Hi, I have the following code where there is some client side VBScript that does something and needs to pass a variable back to the ASP.NET page. When the page is updated through a postback, the information is lost. What am I doing wrong? After obtaining the variable, I assign it back to a Label text field on the form, it shows up on the...
5
2290
by: Drum2001 | last post by:
I have a database that allows the user to input a department code and get all the employees within the department. The table is generated from another script that places the numeric code as a text field, which is fine. My question is the following: When I ask the user to input a department code, for example 8615, it will bring up the...
2
1903
by: peter | last post by:
I have a xslt that writes a txt file from xml. Xml file is generated by a user input on a webpage and some nodes have linebreaks which corrupts my output. is there a way to generally set that xslt should ignore linebreaks or a way to use <xsl:value-of select="$VALUE"/and clear $VALUE of linebreaks or replace them with spaces?? Thanks alot!...
1
3442
by: Andrew Wan | last post by:
How can VBScript code access JScript code variables in the same ASP page? <SCRIPT LANGAUGE="VBScript"> Dim a a = 10 </SCRIPT> <SCRIPT LANGUAGE="JScript"> Response.Write(a); </SCRIPT>
0
7710
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...
0
8040
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8225
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...
1
7800
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...
0
6437
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...
1
5610
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3745
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2230
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
0
1051
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.