Hello,

On 08/25/2003 12:43 AM, Kris Reid wrote:
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 ?

If you want to send a message directly to recipient SMTP server, you may want to try this SMTP class enabling the direct delivery mode.


http://www.phpclasses.org/smtpclass


To actually compose the message you want to send, you would better use that in class in conjunction with this other class for composing and sending e-mail messages. It comes with a sub-class specialized in deliverying via SMTP that using the class above.


http://www.phpclasses.org/mimemessage



--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to