Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need to enter carriage returns in email via CDO

Status
Not open for further replies.

opticalman

Programmer
Nov 6, 2006
103
US
I am using vfp8.0
I am trying to send an order via email
i am using code I found MSDN VFP forum
I can send the email.
here is the code
Code:
loConfig = CREATEOBJECT( 'CDO.Configuration' )
loMsg    = CREATEOBJECT( 'CDO.Message' )

WITH loMsg
  .Configuration = loConfig
  .TO       = "someone@hotmail.com" 
  .Subject  = "order from myplace"
  .HTMLBody = "line1"
  .HTMLBody = .HTMLBody + "line2"  
  .SEND()
ENDWITH

loConfig = .NULL.
loMsg    = .NULL.

the problem is formating the BODY text. For now, I want to put a carraige return at the end of each line. I can not get CHR(13) to work. example "line1"+ chr(13)+"line2" yields "line1line2"

thanks for any help

Jim Rumbaugh
 
Since you're populating .HTMLBody, I suspect you want "<BR>" (or even "<P>") instead.

HTML disregards CRLF.
 
DanFreeman

Thanks Dan
As soon as I read your answer a lightbulb lit up. Now I realize what .HTMLBODY means. With a little research I found the metod/property .TextBody

By using .TextBody instead of .HtmlBody I can now do what I want. I have used:
REPORT FORM MyReport TO FILE ReportText ASCII

I then use the command
.TextBody = FILETOSTR( "ReportText.txt")

It works the way I want.
I consider this question solved and closed.

Thank you.

Jim Rumbaugh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top