Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_cdo thread: Formatting Mail output


Message #1 by "Matthew Lohr" <mlohr@t...> on Mon, 17 Apr 2000 11:42:22 -0400

I am trying to format the output of a mail message by adding spaces and

breaks.  I am not getting the syntax right I know but I am not sure what is

wrong.  My code is as follows.  I want the spaces and breaks in between the

variables that I am adding to the strmsgBody.  This is in line 10.











<%



Dim myMail	'Variable for the mail object

Dim strmsgsubj

strmsgsubj = Trim(Request("msgsubj")) 'String variable to hold the body of

the message

Dim recipient

recipient = Trim(Request ("email"))

strmsgsubj = Trim(Request("msgsubj")) 'String variable to hold the body of

the message

Dim strmsgbody

strmsgbody = Trim(Request("first") &

Request("address")&Request("city")&Request("state")&Request("zip")&Request("

hphone")&Request("guests")&Request("destination")&Request("msgbody"))

'String variable to hold the body of the message

Set myMail = Server.CreateObject("CDONTS.NewMail")

myMail.Subject = strmsgsubj

myMail.Body = strmsgBody	'The body of the message

myMail.To = "mlohr@t...," & recipient	'Where the message is going

myMail.From = "mlohr@k..."

myMail.Send	'sends the email







%>



Message #2 by "Matthew Lohr" <mlohr@t...> on Mon, 17 Apr 2000 11:48:11 -0400
Well I figured out that spaces is as easy as  & "   ".  I still need to

figure out breaks.



-----Original Message-----

From: Matthew Lohr 

Sent: Monday, April 17, 2000 11:42 AM

To: 'ASP CDO'

Subject: Formatting Mail output







I am trying to format the output of a mail message by adding spaces and

breaks.  I am not getting the syntax right I know but I am not sure what is

wrong.  My code is as follows.  I want the spaces and breaks in between the

variables that I am adding to the strmsgBody.  This is in line 10.











<%



Dim myMail	'Variable for the mail object

Dim strmsgsubj

strmsgsubj = Trim(Request("msgsubj")) 'String variable to hold the body of

the message

Dim recipient

recipient = Trim(Request ("email"))

strmsgsubj = Trim(Request("msgsubj")) 'String variable to hold the body of

the message

Dim strmsgbody

strmsgbody = Trim(Request("first") &

Request("address")&Request("city")&Request("state")&Request("zip")&Request("

hphone")&Request("guests")&Request("destination")&Request("msgbody"))

'String variable to hold the body of the message

Set myMail = Server.CreateObject("CDONTS.NewMail")

myMail.Subject = strmsgsubj

myMail.Body = strmsgBody	'The body of the message

myMail.To = "mlohr@t...," & recipient	'Where the message is going

myMail.From = "mlohr@k..."

myMail.Send	'sends the email







%>



Message #3 by JAMES <james@g...> on Mon, 17 Apr 2000 11:08:27 -0500
How about this:



& vbCrLf



This will add a Carriage Return Lne Feed



-----Original Message-----

From: Matthew Lohr 

Sent: Monday, April 17, 2000 10:48 AM

To: ASP CDO

Subject: [asp_cdo] RE: Formatting Mail output





Well I figured out that spaces is as easy as  & "   ".  I still need to

figure out breaks.



-----Original Message-----

From: Matthew Lohr 

Sent: Monday, April 17, 2000 11:42 AM

To: 'ASP CDO'

Subject: Formatting Mail output







I am trying to format the output of a mail message by adding spaces and

breaks.  I am not getting the syntax right I know but I am not sure what is

wrong.  My code is as follows.  I want the spaces and breaks in between the

variables that I am adding to the strmsgBody.  This is in line 10.











<%



Dim myMail	'Variable for the mail object

Dim strmsgsubj

strmsgsubj = Trim(Request("msgsubj")) 'String variable to hold the body of

the message

Dim recipient

recipient = Trim(Request ("email"))

strmsgsubj = Trim(Request("msgsubj")) 'String variable to hold the body of

the message

Dim strmsgbody

strmsgbody = Trim(Request("first") &

Request("address")&Request("city")&Request("state")&Request("zip")&Request("

hphone")&Request("guests")&Request("destination")&Request("msgbody"))

'String variable to hold the body of the message

Set myMail = Server.CreateObject("CDONTS.NewMail")

myMail.Subject = strmsgsubj

myMail.Body = strmsgBody	'The body of the message

myMail.To = "mlohr@t...," & recipient	'Where the message is going

myMail.From = "mlohr@k..."

myMail.Send	'sends the email







%>

Message #4 by James Texter <texter@o...> on Mon, 17 Apr 2000 11:38:44 -0500
Matthew,

	If you are wanting to put in line breaks, you simply format your line as:

	strMsgBody = variable1 & " " & variable2 & vbCrLf & ...



Basically, the "vbCrLf" is the VBScript constant for carriage return and

line feed.



James



-----Original Message-----

From: Matthew Lohr 

Sent: Monday, April 17, 2000 10:48 AM

To: ASP CDO

Subject: [asp_cdo] RE: Formatting Mail output





Well I figured out that spaces is as easy as  & "   ".  I still need to

figure out breaks.



-----Original Message-----

From: Matthew Lohr

Sent: Monday, April 17, 2000 11:42 AM

To: 'ASP CDO'

Subject: Formatting Mail output







I am trying to format the output of a mail message by adding spaces and

breaks.  I am not getting the syntax right I know but I am not sure what is

wrong.  My code is as follows.  I want the spaces and breaks in between the

variables that I am adding to the strmsgBody.  This is in line 10.











<%



Dim myMail	'Variable for the mail object

Dim strmsgsubj

strmsgsubj = Trim(Request("msgsubj")) 'String variable to hold the body of

the message

Dim recipient

recipient = Trim(Request ("email"))

strmsgsubj = Trim(Request("msgsubj")) 'String variable to hold the body of

the message

Dim strmsgbody

strmsgbody = Trim(Request("first") &

Request("address")&Request("city")&Request("state")&Request("zip")&Request("

hphone")&Request("guests")&Request("destination")&Request("msgbody"))

'String variable to hold the body of the message

Set myMail = Server.CreateObject("CDONTS.NewMail")

myMail.Subject = strmsgsubj

myMail.Body = strmsgBody	'The body of the message

myMail.To = "mlohr@t...," & recipient	'Where the message is going

myMail.From = "mlohr@k..."

myMail.Send	'sends the email







%>



Message #5 by "Matthew Lohr" <mlohr@t...> on Mon, 17 Apr 2000 12:46:10 -0400
See that is why i love this list.  Great it worked out perfect thanks

-----Original Message-----

From: JAMES 

Sent: Monday, April 17, 2000 12:08 PM

To: ASP CDO

Subject: [asp_cdo] RE: Formatting Mail output





How about this:



& vbCrLf



This will add a Carriage Return Lne Feed



-----Original Message-----

From: Matthew Lohr

Sent: Monday, April 17, 2000 10:48 AM

To: ASP CDO

Subject: [asp_cdo] RE: Formatting Mail output





Well I figured out that spaces is as easy as  & "   ".  I still need to

figure out breaks.



-----Original Message-----

From: Matthew Lohr

Sent: Monday, April 17, 2000 11:42 AM

To: 'ASP CDO'

Subject: Formatting Mail output







I am trying to format the output of a mail message by adding spaces and

breaks.  I am not getting the syntax right I know but I am not sure what is

wrong.  My code is as follows.  I want the spaces and breaks in between the

variables that I am adding to the strmsgBody.  This is in line 10.











<%



Dim myMail	'Variable for the mail object

Dim strmsgsubj

strmsgsubj = Trim(Request("msgsubj")) 'String variable to hold the body of

the message

Dim recipient

recipient = Trim(Request ("email"))

strmsgsubj = Trim(Request("msgsubj")) 'String variable to hold the body of

the message

Dim strmsgbody

strmsgbody = Trim(Request("first") &

Request("address")&Request("city")&Request("state")&Request("zip")&Request("

hphone")&Request("guests")&Request("destination")&Request("msgbody"))

'String variable to hold the body of the message

Set myMail = Server.CreateObject("CDONTS.NewMail")

myMail.Subject = strmsgsubj

myMail.Body = strmsgBody	'The body of the message

myMail.To = "mlohr@t...," & recipient	'Where the message is going

myMail.From = "mlohr@k..."

myMail.Send	'sends the email







%>



---

You are currently subscribed to asp_cdo




Message #6 by "Andrew Knox" <knoxy@t...> on Tue, 25 Apr 2000 12:53:38
You want to add, for eg:

variable & " " & nextvariable '### this adds a space

OR

variable & "<BR>" &nextvariable '### this adds a line break



hope this helps,

andrew knox


  Return to Index