473,407 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Using PHP to parse emails and print to specific printer

Hi everyone,

We're trying to write a script that will monitor 6 email addresses and
if an email arrives it will print to a specific network printer based
on the email address. So if the address is 'd**********@domain.com' it
will print to 'dept1ptr'. Each printer can be setup either on a
network print server or printed to directly via IP address... they're
all HP printers.

Any suggestions on a route to go with this? I'm very familiar with PHP
but I've never written a script to do something like this... and if PHP
isn't the right avenue to take, I'd love other options.

Thanks in advance for any suggestions on how to approach this. Take
care,

Alex.

Aug 16 '06 #1
3 2482
Since your familiar with PHP, I would recommend you stay using the
language you know the most about. You could set this up using PHP CLI
(Command Line Interface) & IMAP, POP3 and NNTP Functions. Thus the ways
of approaching inital design depend on your platform (Linux, Windows)?

Other options... I would write it in Perl, running Fedora Core. But
that me.

Good Luck

-Nic

Alex wrote:
Hi everyone,

We're trying to write a script that will monitor 6 email addresses and
if an email arrives it will print to a specific network printer based
on the email address. So if the address is 'd**********@domain.com' it
will print to 'dept1ptr'. Each printer can be setup either on a
network print server or printed to directly via IP address... they're
all HP printers.

Any suggestions on a route to go with this? I'm very familiar with PHP
but I've never written a script to do something like this... and if PHP
isn't the right avenue to take, I'd love other options.

Thanks in advance for any suggestions on how to approach this. Take
care,

Alex.
Aug 16 '06 #2
NC
Alex wrote:
>
We're trying to write a script that will monitor 6 email
addresses and if an email arrives it will print to a specific
network printer based on the email address.
What OS are you planning to run it on?

Cheers,
NC

Aug 16 '06 #3
Alex wrote:
Hi everyone,

We're trying to write a script that will monitor 6 email addresses and
if an email arrives it will print to a specific network printer based
on the email address. So if the address is 'd**********@domain.com' it
will print to 'dept1ptr'. Each printer can be setup either on a
network print server or printed to directly via IP address... they're
all HP printers.

Any suggestions on a route to go with this? I'm very familiar with PHP
but I've never written a script to do something like this... and if PHP
isn't the right avenue to take, I'd love other options.

Thanks in advance for any suggestions on how to approach this. Take
care,

Alex.
Alex,

You have two possibilities, depending on the mail server you're using.

If the mailserver allows piping, you can pipe the incoming mail to the
script with the appropriate recipient (details depend on the server).

If not, you can set up a cron job to monitor the queue for input. For
instance, if it is a POP3 server, you could open a socket to port 110
(POP3 port), enter the userid and password and see if there is any
incoming mail. If there is, receive and process it. A bit complicated,
but not too bad.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Aug 17 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: chuck amadi | last post by:
Hi , Im trying to parse a specific users mailbox (testwwws) and output the body of the messages to a file ,that file will then be loaded into a PostGresql DB at some point . I have read the...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
0
by: Tessa | last post by:
Is there any security reason why you cannot print to a network printer from ASP.NET under IIS6 on Windows 2003 server? I'm using ASP.NET code to print to a server print queue using...
12
by: Peter Lin | last post by:
Hey, I am just wondering if anyone has got any idea of setting up a new class so that you could just print like the old ways with the printer class, since I am writing a program that really...
2
by: Wayne | last post by:
I'm using the following line of code to print only the first page of a report: DoCmd.PrintOut acPages, 1, 1 This works fine with one limitation. It sends the report to the default printer. ...
1
by: Marc Rowe | last post by:
Hello, I have a client who needs to print HTML Files using IE - i have the automation completed, but cannot find anywhere how to print to a printer that is not the default printer - the HTML files...
1
by: gwong | last post by:
How can I tie window.print() to a specific printer? I've created a print button but don't want the pop up to occur that gives the printer selections. I am trying to minimize the number of clicks...
5
by: Carl Witte | last post by:
Hello. I'm stuck. I've got a form I need to print to a manual feeder on a shared laser printer. This will get me to the printer but I can't seem to figure out how to print it to a specific bin. ...
2
by: dpw.asdf | last post by:
I have been searching all over for a solution to this. I am new to Python, so I'm a little lost. Any pointers would be a great help. I have a couple hundred emails that contain data I would like to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.