473,386 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 19878
Jeff Thies wrote on 07 aug 2003 in microsoft.public.inetserver.asp.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.
sPlainTextMessageBody = "Dear Sir," & vbCrLf & vbCrLf & "Here's a message."
sHTMLMessageBody = "Dear Sir,<BR><BR>Here's a message."

Ray at work
"Jeff Thies" <cy*******@sprintmail.com> wrote in message
news:3F***************@sprintmail.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.public.inetserver.asp.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
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...
7
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...
20
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...
3
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...
1
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...
2
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...
5
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...
2
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...
1
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
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...

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.