Hi

I'm trying to build a program using PHP to increase the performance of Qmail.

I'm trying to use PHP to send an email qmail-remote which connects directly to the 
recipients mail server.
If this fails it will then add it to the queue normally so it can retry later.

Here is what I have so far (Note this runs on the command line)

function sendMail($host, $to, $from, $message) {

 $prog = "/var/qmail/bin/qmail-remote $host $from $to";
 echo "Program = $prog \r\n";

 $handle = popen ($prog, "w");
// fwrite($handle, $message) ;
 pclose($handle);
 }

The problem I have is I don't know how to write the message.
When you manually run qmail-remote $host $from $to
You then have to type the message then press control + D
Just like the standard mail function in UNIX

How can I type "Message control + D" into the program ?

Thanks

Kris

Reply via email to