E-mail and Fax-Enabling Mfg/Pro
Joe Drouillard 
Principal/Consultant
Avenue Systems
(248) 894-7093
www.avenue-systems.com

In QAD Mfg/Pro it is easy for any user to send a report to an email destination using the predefined "email" printer device.  Unfortunately, the report is sent in the text portion of the email, and not as an attachment which can be opened in another PC program.  For example, a CSV file can easily be opened in Excel if the file is an attachment, but not if it is within the body of an email message.  Another disadvantage of QAD's approach is it does not allow you to send multiple documents to individual recipients in a single process, for example email/faxing P/Os to many different suppliers simultaneously in a single execution.  

The advantages of the approach I am recommending is:  1) Allowing you to send a complex report or text document as a spreadsheet or Acrobat file attachment, instead of a read-only email body, 2)  Allowing you to send multiple emails and faxes with individualized content simultaneously to many recipients in a single execution of a program.  3) Easily extends itself to a solution for Fax-enabling Mfg/Pro.

First, experiment with whatever e-mail facility is available on the same platform as Mfg/Pro, to send an e-mail from the command line.  In UNIX, this is probably the "mailx" or "mutt" command.  (The mutt utility is free and widely available, and is highly recommended and preferable when sending attachments.  Mailx will not send attachments in my experience without encoding using the uuencode command, which is a bit finicky and can blow up on you when upgrading to a new UNIX version.)  Mutt is run from the system prompt, and can be easily installed and enabled by your DBA or UNIX Sysadmin.  If  yours is a Windows environment, then see if your e-mail facility will let you send a simple e-mail from the DOS prompt, or see if your Sysadmin can install a send-only email command line facility.  This may take a little digging.   Your goal is to be able to send a simple e-mail to yourself from the command line.  Then, experiment further to get it to send the message body from a simple text file, and also to send a message attachment, again all from the command line.  The attachment you try can be an XLS spreadsheet, PDF, or simple CSV file.   But it is important that you be able to use all email send functionality within the command line, since in your Progress .p program, you will be essentially doing the same thing; i.e.: mimicking the UNIX or Windows cmd line.

Here is some sample code using mutt:  You can google "mutt" to get many more examples and documentation.

UNIX silent cat mailgtw.txt | mutt -s "Job-XXX-Errors-Warnings" -a value(fileout) -- "qad.admin.ss@mycompany.com".

Sample code notes:

  1. File mailgtw.txt is a simple text file which contains a body message for the email, possibly cotaining relevent information such as date, time, error codes, etc.  Obviously it should be relatively short to fit in an easily read email body, and must be built by our .p before running the above command.
  2. The value of fileout is the name of a file which should be sent with the message as an attachment.  It can be any type of file that can be opened automatically by a PC program such as Excel (xml, xls, csv), Adobe (pdf).  Of course this file must be built by the Progress program before it can be sent.  There are UNIX and Windows command line utilities for building PDFs from reports.  A CSV file can be built using the Progress export statment.  I intend to write an article soon on how to create a more fully formed spreadsheet using XML.
  3. The above email is sent to a distribution list called "qad.admin.ss" on the mycompany email (eg Outlook) server.
  4. The UNIX mailx command is probably already on your server, but I like mutt better since it does not require you to use uuencode to build the attachment files.
  5. You will note several hardcoded/constant values, eg mailgtw.txt and the subject "Job-XXX-Errors-Warnings".  These could have also been setup as variables then inserted using the UNIX value paramater.

Email addresses for employees can be obtained from the QAD user table, supplier and customer email addresses can be stored and obtained in the supplier and customer masters.  Or program a simple maintenance screen to store e-mail addresses in a file accessible by Mfg/Pro.  Normally, I use the usrw_wkfl, using one field for the supplier, customer, or employee-id, another field for type (customer, supplier, etc.), and a third field for the actual e-mail address.  

Then, when in an activity where e-mail is to be sent, the text message or report (perhaps a single or multi-page P/O) is stored in a text file, using the output to command.   Optionally, the file is then converted to a PDF or XML spreadsheet.  Then, the appropriate command line system command described above is used with the supplied recipient's e-mail address.   This is done iteratively in the program until all messages (say, a P/O to every supplier receiving one that day) have been sent.  Naturally, if the supplier has no e-mail address, then then it is assumed that the supplier is not set up for e-mail and will be printed using the normal print P/O function.

Automating Fax Sending in QAD Mfg/Pro:  
Once e-mails are working, faxing output from Mfg/Pro can be implemented easily using an e-mail fax server.  This is done by e-mailing the fax server the text message and fax number.  The fax number is often part of the e-mail address, or it can be hidden in the subject line of the email, depending on which fax server or internet fax service you use.  The document (e.g.: P/O)  is sent in the body of the e-mail, or better yet as a PDF attachment.  Fax servers can be installed internally on your company network.  But, it is often more economical to use an external fax service company, such as efax.com.  These third party internet services typically have low setup charges, fast implementation, and low per-minute phone charges.  There is often no need for additional hardware and software, since you simply e-mail  the fax data to the external fax service.  Here is a sample e-mail destination address, when using a fax service:  
  
                    fax:248-669-1234@faxservice.com

In the above example, "248-669-1234" is the ultimate recipient's fax phone number, and "faxservice.com" is the e-mail server of the fax service (internal or external) that you are using. This is e-mailed to the fax service, which then faxes the document to the ultimate recipient. The P/O  or other text message is put in the body of the fax.  The fax topic is often obtained from the email subject line, depending on which fax service or server you use.  There is also normally an option for the sender to receive an e-mail notification of faxes sent with status and time received.

I have implemented this a few times with great success/user satisfaction.  A user who no longer needs to spend mind-numbing hours standing at a fax machine will be your best friend! 

One final point.  If the information is really important, such as a purchase order or a check image, it may be better to send the document using a web portal, which is a more reliable and password protected mechanism than email.  Contact me if you are interested in discussing extremely cost-effective web portals.

Please feel free to contact me if you would like any assistance. 

 

J o s e p h  D r o u i l l a r d 
Principal/Consultant
Avenue Systems 
Detroit Contract Progress/QAD 
40928 Kingsley Ln 
Novi Michigan 48377 
joe "at" avenue-systems "dot" com
http://www.avenue-systems.com/



© 2011 Avenue Systems LLC
Valid HTML 4.01 Transitional     Valid CSS 2.01