linebreaks in VBScript variables

J

Jeff Thies

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
 
E

Evertjan.

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
 
R

Ray at

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
 
J

Jeff Thies

Thanks to all!

Comments below.

Evertjan. said:
Jeff Thies wrote on 07 aug 2003 in microsoft.public.inetserver.asp.general:

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
 

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
474,079
Messages
2,570,575
Members
47,207
Latest member
HelenaCani

Latest Threads

Top