No announcement yet.

Email Printer Driver?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Email Printer Driver?

    I tried a Google this AM looking for:

    "Printer driver which will 'print' a file by creating an email and prompting the user for the destination address"

    Baiscally I want this to work like Explorer with "send selected files to email recipient"

    The only one I found which did *not* work by converting the file to an image file was

    That there weren't all that many found suggests to me I am missing something obvious here.. like maybe I should just call the appropriate SMTP functions and just "do it myself."

    This application is going to generate a PDF file which the user will then have the option of emailing, faxing or printing on a printer... or combinations of same. I thought it would be neat if I could have "email" and "fax" come up in the common "Select Printer" dialog we see in many Windows applications. I know there are "fax" drivers already, so if there were an "email" driver that would make this a lot simpler to do.

    Other tools? Should I just "do it myself?" Comments?

    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]

  • #2

    There are a couple ways of doing this, but it depends a lot on what application is creating the information in the first place and who you're sending to. For example, if you have a "print to email" driver and it doesn't do any conversions, and you write a letter in WordPerfect v2.1 and "print" it to email.... who's going to be able to read that on the other end? Some form of conversion almost has to take place, either to plain text, HTML, PDF, or some form of universal graphic image. Otherwise, you run the likely risk of not being able to read what you sent, and/or having your emails bounced because of 'strange' content.

    What I've finally ended up doing, is using nothing but PDF for my output. That way, the end user can do just about anything they need with it right from the PDF reader. They can print it, they can fax it, they can email it, and I don't have to mess with code for any of it. Also, if they send a document from my application as an attachment, I don't have to worry about the person on the other end having any special DLLs, etc. If they don't have Acrobat, a simple email with the link to the free Adobe download is all I need to do. Its far to universal these days.

    If you think about it 'Print-to-Fax' and 'Print-to-PDF', these are doing conversions too, just not to standard images. So unless you want to 'convert' all your documents to be emailed to plain text, you're probably not going to have much luck in this area. If you do want to use just plain text, you shouldn't have a problem 'rolling your own'. There are lots of SMTP samples here.
    Last edited by Joe Byrne; 8 Jun 2008, 10:44 AM.
    Software makes Hardware Happen


    • #3
      i do not know how much specialization you need.
      but just something for you to think about.
      create a printer, have the spool file go some specific directory.
      set the system to keep all files and use port NUL to print to.
      if it is your program, name the printer specific for your program, i would use something like ZZMCMPTR01, so it would always sort to the bottom on printer dialogs.
      if it is your program, you might be able to put your filenames in the printed information, then you have to have a program watch that directory for changes or something else, read the files in the spool directory, scrub the print file for your file names and go from there.
      naturally there are other many other steps
      or even a better thought, if the printer is your printer set up,ZZMCMPTR01, when the person picks that specific printer, just print the code of what to do. you would use a plain text printer driver for that. and like is said, read the file if any files are there and get your commands you printed, then interrupt the script and do what you need to do. Or do a script that windows understands and pass that printed script to a file then run it, much like a vb script. you can even get fancy and store those and/or make logs from them.
      Last edited by Paul Purvis; 9 Jun 2008, 03:57 PM.
      p purvis


      • #4
        The application is creating the file and can name it or put it anywhere.

        The client is still thinking about if he wants to choose "where/how to print and/or show and/or fax and/or attach and email" BEFORE I create the file or AFTER I create the file.

        I'm just building up options here. The user in this case is an accounts receivable person, who is selecting one or more invoices to reprint (as PDF)... and will be providing said reprinted invoices to the customer.

        (Remember other thread where I told you about the A/R people not wanting to deal with delays when the non-payer uses the "I can't find this invoice you allege I have not paid" excuse, er "explanation?" Same application.)

        PS: I am NOT using a "Print to PDF" print driver to create the PDF file. I am using HARU library v 2.08.
        Last edited by Michael Mattias; 9 Jun 2008, 09:49 AM.
        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]


        • #5
          Michael: Is this of any help?


          • #6
            AttachPlus doesn't appear to be quite rght for this application, but thank you anyway.

            While preserving options I got the MAPI interface working to "attach to an email and send" code working. (Got it working AGAIN. I got that code here a long time ago). The resulting function is like a one-liner, works great. I end up with something like...

              X = CreatePDFFIle ( szPDF, other params) 
              IF ISTRUE sendViaEmail
                   CALL SendPDFViaEmail (email_Address, szPDF) 
              END IF
            Don't get a whole lot easier than that.

            I think I'll just forget about looking for an email "printer driver".
            Michael Mattias
            Tal Systems (retired)
            Port Washington WI USA
            [email protected]


            • #7
              i think that is wise.
              i just did not want to suggest you do that in the beginning.
              it probably will work a look better too.
              and more dependable than some print functions anyways.
              what is funny, i have seen you many times suggest some simple way to do something.
              i would take that road too.
              p purvis