Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Microsoft: FoxPro FAQ

COM and Automation

How can I use a record from a DBF and send it with other variables to an email but with spaces between paragraphs by keepingbusy
Posted: 17 Nov 03

First off, let me give credit where it's due: SlightHaze, Ramani and Steveb7

After advice from the above Tek-Tips users we were able to solve a problem that may help you. The only way to show you this is by pasting the whole code we used to get there in the end. I'm sorry it's long winded but it works and I have no doubts that the experts out there will pull it apart and condense it somewhat to all our advantage. Anyway, I hope it helps someone so here was the problem.

We needed to select a record from our DBF, add some information, put it into paragraphs then send the whole thing to an email with the click of a command button. Some of the original wording has been altered using *** so please amend it and try your own. Here it is...

nmessage=MESSAGEBOX("Email Reminder To This Recipient?"+space(15),4+32+0,"System Message")
IF nmessage=7

DECLARE integer ShellExecute IN shell32.dll ;
  integer hndWin, string cAction, string cFileName, ;
  string cParams, string cDir, integer nShowWin

LOCAL cEmail, memailtx1, memailtx2, memailtx3, memailtx4, memailtx5, memailtx6, ;
  memailtx7, memailtx8, memailtx9, memailtx10, memailtx11, memailtx12, memailtx13, ;
  memailtx14, memailtx15, memailtx16, memailtx17, memailtx18, memailtx19, memailtx20, ;
  mserialfm, mserialto

memailtx1 = "Dear Certificate Holder%0d%0a"
memailtx2 = " %0d%0a"
memailtx3 = "We would like to remind you that your current donation to the"+ ;
  " *** Foundation is about to expire soon and the last draw you are entitled "+ ;
  "to take part is due on "+cdow(date12)+" "+dmy(date12)+".%0d%0a"
memailtx4 = " %0d%0a"
memailtx5 = "If you renew your รบ"+LTRIM(STR(amount))+" certificate, you will have "+LTRIM(STR(amount))+ ;
  " opportunities in every one of a total of 12 *** Prize Fund draws giving you"+ ;
  " an overall opportunity level of "+LTRIM(STR(amount*12))+" throughout the 12 *** Draws.%0d%0a"
memailtx6 = " %0d%0a"
memailtx7 = "You can increase your donation or keep it the same and may do so by either contacting us by "+ ;
  "telephone or by registering a new donation online at ourukwebsitename %0d%0a"
memailtx8 = " %0d%0a"
memailtx9 = "Thank you for taking part in the *** experience and we look forward to hearing from you.%0d%0a"
memailtx10= " %0d%0a"
memailtx11= "Yours faithfully,%0d%0a"
memailtx12= " %0d%0a"
memailtx13= " %0d%0a"
memailtx14= "For the *** Foundation%0d%0a"
memailtx15= " %0d%0a"
memailtx16= "Your existing reference numbers are below%0d%0a"
memailtx17= " %0d%0a"

cEmail = "mailto:"+LOWER(TRIM(EMAIL))+"?Subject=Certificate Renewal Reminder"+ ;
  "&Body= " + memailtx1 + chr(13) + chr(10) + memailtx2 + chr(13) + chr(10) + memailtx3 + ;
  memailtx4 + chr(13) + chr(10) + memailtx5 + chr(13) + chr(10) + memailtx6 +chr(13) + chr(10) + ;
  memailtx7 + chr(13) + chr(10) + memailtx8 + chr(13) + chr(10) + memailtx9 +chr(13) + chr(10) + ;
  memailtx10 + chr(13) + chr(10) + memailtx11 + chr(13) + chr(10) + memailtx12 +chr(13) + chr(10) + ;
  memailtx13 + chr(13) + chr(10) + memailtx14 + chr(13) + chr(10) + memailtx15 +chr(13) + chr(10) + ;
  memailtx16 + chr(13) + chr(10) + memailtx17 + chr(13) + chr(10) + memailtx18


CLEAR DLLS ShellExecute

So there it is. This works using VFP version 6 and Outlook Express Version 6

Good luck

Lee (KB)

Back to Microsoft: FoxPro FAQ Index
Back to Microsoft: FoxPro Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close