Re: How to put line feeds into email sent by VFP? by Java
Java
Mon Sep 15 02:21:19 CDT 2003
Perhaps I used the term 'send mail' too loosely...it doesn't actually
send the email, it prepares the contents (address, subject, body, etc.),
opens the default email application with an empty new email, and stuffs
the contents into the appropriate places. The user can then review it,
modify it, add an attachment, or whatever...and then has to click Save or
Send to actually send the thing. Anyway, here is the code I've tried out
in creating my test to see how it all works. Ultimately, I'll use real
data, vars, etc. but the idea is the same: I want to 'compose' emails
using VFP which will have multiple lines of body text. So if anyone can
tell me how to get those line feeds into the body, I'll be ever so happy!
declare integer ShellExecute in shell32.dll ;
integer hndWin, string cAction, string cFileName, ;
string cParams, string cDir, integer nShowWin
lcAddress = "mailto:" + alltrim(ThisForm.cboAddress.displayvalue)
lcCopy = iif(!empty(ThisForm.cboEmailCopy.displayvalue),'?CC=' ;
+ alltrim(ThisForm.cboEmailCopy.displayvalue),'')
lcSubject = '&Subject=Meeting plans'
lcDate = 'Meeting date: ' + ;
dtoc(ThisForm.Ccalendardate1.txtdate.value) + ;
chr(13) + chr(10)
lcTime = 'Meeting time: ' + ThisForm.txtTime.value + ;
chr(13) + chr(10)
do case
case ThisForm.opgLocation.value = 1
lcPlace = 'Location: Office' + chr(13) + chr(10)
case ThisForm.opgLocation.value = 2
lcPlace = 'Location: Client' + chr(13) + chr(10)
case ThisForm.opgLocation.value = 3
lcPlace = 'Location: ' + ThisForm.edtLocation.text ;
+ chr(13) + chr(10)
endcase
do case
case ThisForm.opgReturnAction.value = 1
lcFollowup = 'I will phone you after our meeting' ;
+ chr(13) + chr(10)
case ThisForm.opgReturnAction.value = 2
lcFollowup = 'I will email you after our meeting' ;
+ chr(13) + chr(10)
case ThisForm.opgReturnAction.value = 3 && No followup
lcFollowup = ''
endcase
lcBody = '&Body=lcDate + lcTime + lcPlace + lcFollowup
lcMail = lcAddress + lcCopy + lcSubject + lcBody
ShellExecute(0,"open",lcMail,"","",1)
In article <uqisSXxeDHA.3204@TK2MSFTNGP11.phx.gbl>,
paulnospam@laberg.com.au says...
> I must be missing something ... my understanding of shellExecute is that it
> sends a verb "open" to the controlling program for a particular file
> extension. That would imply that lcMail contains the name of a ".oft" that
> is already written onto the harddrive. Can you show the code that takes the
> variables and actually creates the message. I have used carriage returns and
> linefeeds in emails before and they worked.
>