Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 07:28 AM
Jeff Thies
Guest
 
Posts: n/a
Default 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
  #2  
Old July 19th, 2005, 07:28 AM
Evertjan.
Guest
 
Posts: n/a
Default Re: linebreaks in VBScript variables

Jeff Thies wrote on 07 aug 2003 in microsoft.public.inetserver.asp.general:[color=blue]
> I'm trying to format an email message. The message has line breaks in
> it. How do I do this in VBScript?[/color]

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)
  #3  
Old July 19th, 2005, 07:28 AM
Ray at
Guest
 
Posts: n/a
Default Re: linebreaks in VBScript variables

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" <cyberjeff@sprintmail.com> wrote in message
news:3F327A3E.19A17049@sprintmail.com...[color=blue]
> 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[/color]


  #4  
Old July 19th, 2005, 07:28 AM
Jeff Thies
Guest
 
Posts: n/a
Default Re: linebreaks in VBScript variables

Thanks to all!

Comments below.

"Evertjan." wrote:[color=blue]
>
> Jeff Thies wrote on 07 aug 2003 in microsoft.public.inetserver.asp.general:[color=green]
> > I'm trying to format an email message. The message has line breaks in
> > it. How do I do this in VBScript?[/color]
>
> You cannot send an email message with asp vbs, you need an application.
>
> So tell us your application.[/color]

CDONTS[color=blue]
>
> =====================
>
> 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[/color]

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


[color=blue]
> mybody = mybody & "yours truly," & VbCrLf
> mybody = mybody & "etc." & VbCrLf
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)[/color]
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles