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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

To email reports ie sending report to clients via emial

Status
Not open for further replies.

kristover

Programmer
Jun 20, 2016
2
NG
thanks for the candid attention and answers.
I have a payroll system developed in VFP9. I WANT TO SEND MY REPORTS EG PAY SLIPS TO EMPLOYEES MAIL BOX VIA EMAIL. I AM FINDING THIS PROBLEM HARD TO SOLVE. PLEASE I NEED YOUR HELP.
THANKS
KRISTOVER
 
FoxyPreviewer may be for you. It has the features of a) creating PDFs of reports you run and b) mail the output PDF file as attachment of a mail.

If you want to do it yourself, simple to use ingredients are
1. A printer driver creating files (PDF) - FoxyPreviewer instead makes use of a library for creating PDFs directly.
2. Mailing code - many ways to do this are available.

in regard of 1: eg PDF Creator allows to configure an output name pattern, so no user interaction is asking for a file name. The PDF is created in a output folder with for example sequential numbering.

in regard of 2: Choose how to send mails in many ways, eg
several more

If you have Outlook (Office Outlook not Windows Mail aka Outlook Express) you may use the perhaps simplest way to send mail via Outlook.Application automation, see faq184-766 (the FAQ is old and also valid for any newer Outlook version)

There is no excuse you don't find any way to send mail with VFP.

Bye, Olaf.
 
Kristover,

If you could let us know what steps you have already taken, and what specific difficulties you are seeing, that would be helpful. Also, what general approach are you taking? There are several approaches to sending emails programmatically, each with their pros and cons; there is no point in us explaining one of them to you, if you are taking a different one.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Well,

with the usual approach to create PDFs and mail them, in the situation you are in - having reports - you just do two things:
1. Before REPORT FORM you SET PRINTER TO NAME "NameOfPDFPrinter", then report as usual
2. Knowing the output file you use eg the Outlook FAQ Code, which mainly is a few lines and send the pdf as mail attachment.

So this type of feature is a rather simple task in comparison to writing a payroll system with database design, data maintenance and reporting.

I trust you can do this. I agree with Mike in that the outset may determine what you can use. I can warn you about MAPI. If you want to sell the payroll system and not just use it as your companies self developed payroll system, MAPI seems to be the most standard conformant way to mail with any outset, but this API is a bit tricky and several OS and MAPI versions including the types of Simple MAPI vs Extended MAPI you need different ways of handling it in different situations.

One way out obviously is making certain supported Mail clients a requirement. You may find out what your customers are willing to use, eg either Outlook or a service like Gmail for business, You are very independent from external things, if you go the way of not automating a mail client but send the mail directly to a (configurable) Mail server, that means making your app a mail client itself. In that case the sent mails won't end in the sent mails folder of the users mail client. If that becomes a requirement you also have several ways out, eg exporting the mails your app sends in a standard format like MIME formatted files as EML. A royal discipline would be supporting Exchange so this will go into a companies accounting profile and not just any users own mail client profile.

Anyway, if you write a system in FoxPro, I don't think you'd want to compete with large payroll HR systems supporting MS Exchange, Novell Domino, Tobit David or others.

Bye, Olaf.
 
KRISTOVER said:
I AM FINDING THIS PROBLEM HARD TO SOLVE

Since there are various parts to what you describe - What part of things are you having problems with?

Both Olaf & Mark have both given you excellent advice on how to print each "pay slip" as an individual PDF document and then to send it as an email attachment to the recipient via their email address.

We typically won't GIVE YOU THE CODE, but we will advise you on how to approach a problem. However in order to do that effectively, you have to be clear on what the problem is.

Good Luck,
JRB-Bldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top