[Proposal] esmtp
| From: | Piotr Klaban | Date: | Fri, 27 Aug 2004 13:57:42 +0000 |
| Subject: | [Proposal] esmtp | ||
| Groups: | php.pecl.dev | ||
| Request: | Send a blank email to pecl-dev+get-1230@lists.php.net to get a copy of this message | ||
Hi,
I would like to propose PECL extension:
esmtp is a wrapper for SMTP client library based on the libESMTP library
(http://www.stafford.uklinux.net/libesmtp/)
libESMTP license is LGPL (not GPL).
I have created the phpdoc API documentation in XML.
Where to put these files?
Example code would look like this (you can also send messages
using internal SASL, and external/openssl SSL support):
$session = new Esmtp_Session();
$message = $session->add_message();
$session->set_server ("127.0.0.1:25");
$from = "sample@example.com";
$message->set_reverse_path ($from);
$str = implode('',file('test.eml'));
$message->set_message_str ($str);
$rcpt = 'test-nonexistent@nonexistent-example.com';
$recipient = $message->add_recipient ($rcpt);
$recipient->dsn_set_notify ( NOTIFY_SUCCESS|NOTIFY_FAILURE );
if (!$session->start_session ()) {
echo "SMTP server problem: " . esmtp_strerror (esmtp_errno ()) . "\n";
} else {
$status = $message->transfer_status();
echo $status['code'] . " " . $status['text'] . "\n";
}
I do use underscores in method names, because library uses underscore,
so do Perl extension (Net::ESMTP).
I have created extension a while ago for PHP4, but now I have addapted it to PHP5.
If I release only the PHP5 version, would it worth release also the PHP4 version?
Best regards,
--
Piotr Klaban