cvs: peardoc /en/package/mail/mail-queue/mail-queue mail-queue.xml

From: Date: Mon, 17 Oct 2005 21:05:45 +0000
Subject: cvs: peardoc /en/package/mail/mail-queue/mail-queue mail-queue.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-7000@lists.php.net to get a copy of this message
quipo Mon Oct 17 17:05:45 2005 EDT Modified files: /peardoc/en/package/mail/mail-queue/mail-queue mail-queue.xml Log: fixed bug #5708 Syntax incorrect in example http://cvs.php.net/diff.php/peardoc/en/package/mail/mail-queue/mail-queue/mail-queue.xml?r1=1.1&r2=1.2&ty=u Index: peardoc/en/package/mail/mail-queue/mail-queue/mail-queue.xml diff -u peardoc/en/package/mail/mail-queue/mail-queue/mail-queue.xml:1.1 peardoc/en/package/mail/mail-queue/mail-queue/mail-queue.xml:1.2 --- peardoc/en/package/mail/mail-queue/mail-queue/mail-queue.xml:1.1 Mon Mar 8 06:21:53 2004 +++ peardoc/en/package/mail/mail-queue/mail-queue/mail-queue.xml Mon Oct 17 17:05:39 2005 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.mail.mail-queue.mail-queue.mail-queue"> <refnamediv> <refname>constructor <function>Mail_Queue::Mail_Queue</function></refname> @@ -62,26 +62,26 @@ <![CDATA[ <?php -require_once('Mail/Queue.php'); +require_once 'Mail/Queue.php'; $container_options = array( - 'type' => 'db', - 'database' => 'dbname', - 'phptype' => 'mysql', - 'username' => 'root', - 'password' => '', - 'mail_table' => 'mail_queue' + 'type' => 'db', + 'database' => 'dbname', + 'phptype' => 'mysql', + 'username' => 'root', + 'password' => '', + 'mail_table' => 'mail_queue', ); - //optionally, a 'dns' string can be provided instead of db parameters. - //look at DB::connect() method or at DB or MDB docs for details. - //you could also use mdb container instead db +//optionally, a 'dns' string can be provided instead of db parameters. +//look at DB::connect() method or at DB or MDB docs for details. +//you could also use mdb container instead db $mail_options = array( - 'driver' => 'smtp', - 'host' => 'your_smtp_server.com', - 'port' => 25, - 'auth' => false, - 'username' => '', - 'password' => '' + 'driver' => 'smtp', + 'host' => 'your_smtp_server.com', + 'port' => 25, + 'auth' => false, + 'username' => '', + 'password' => '', ); $mail_queue =& new Mail_Queue($container_options, $mail_options); @@ -94,18 +94,20 @@ $recipient = 'recipient@other_server.com'; $recipient_name = 'recipient'; $message = 'Test message'; -$from_params = empty($from_name) ? '"'.$from_name.'" <'.$from.'>' : '<'.$from.'>'; -$recipient_params = empty($recipient_name) ? '"'.$recipient_name.'" <'.$recipient.'>' : '<'.$recipient.'>'; -$hdrs = array( 'From' => $from_params, - 'To' => $recipient_params, - 'Subject' => "test message body" ); +$from_params = empty($from_name) ? '<'.$from.'>' : '"'.$from_name.'" <'.$from.'>'; +$recipient_params = empty($recipient_name) ? '<'.$recipient.'>' : '"'.$recipient_name.'" <'.$recipient.'>'; +$hdrs = array( + 'From' => $from_params, + 'To' => $recipient_params, + 'Subject' => 'test message body', +); $mime =& new Mail_mime(); $mime->setTXTBody($message); $body = $mime->get(); $hdrs = $mime->headers($hdrs); // Put message to queue -$mail_queue->put( $from, $recipient, $hdrs, $body ); +$mail_queue->put($from, $recipient, $hdrs, $body); // Also you could put this msg in more advanced mode $seconds_to_send = 3600;

« previous php.pear.doc (#7000) next »