| File Name ↓ | File Size ↓ | Date ↓ |
|---|---|---|
| Parent directory/ | - | - |
| MTA-1.0.4.tgz | 10.5 KiB | 2015-Jun-09 03:24 |
| MTA-1.0.3.tgz | 10.5 KiB | 2014-Aug-14 17:53 |
| MTA-1.0.2.tgz | 10.4 KiB | 2013-Sep-25 01:21 |
| MTA-1.0.1.tgz | 10.1 KiB | 2013-Jun-10 15:23 |
| MTA-1.0.0.tgz | 9.7 KiB | 2013-Jun-08 04:48 |
| sha1sum | 280 B | 2015-Jun-09 03:26 |
pear_MTA는 php mail function을 대체할 수 있으며, smtp server나 smtp daemon이 없더라도 자체적으로 메일을 발송할 수 있는 기능을 제공한다.
또한 alternative/mixed 방식의 mail body를 생성하는 method를 제공하며, 발송 시 중복된 메일 주소를 압축하여 중복된 메일 서버에 여러번 접근하지 않도록 최적화 되어 있다.
Reference:
<?php
/*
* Test code for pear_MTA
* $Id: test.php 18 2013-09-24 16:18:30Z oops $
*/
require_once 'MTA.php';
try {
$o = (object) array (
'from' => 'Sender <sender@domain.com>',
'to' => array (
'Receiver1 <user1@domain1.com>',
'Receiver2 <user1@domain2.com>',
'Receiver3 <user2@domain1.com>',
'Receiver4 <user2@domain2.com>',
),
'cc' => 'CC User1 <ccuser@domain1.com>',
'subject' => '보내보아요....',
'body' => 'ㅎㅎㅎ <b>잘</b> 받아 보아요...',
'attach' => array (
'/usr/share/lighttpd/flags/kr.png',
'/usr/share/lighttpd/flags/jp.png'
)
);
$mta = new MTA ();
echo ' ** test MTA::source method' . "\n\n";
$template = $mta->source ($o);
echo preg_replace ('/^/m', ' ', $template);
echo "\n";
echo ' ** test MTA::send method' . "\n\n";
$mta->verbose = true;
$buf = print_r ($mta->send ($o), true);
echo preg_replace ('/^/m', ' ', $buf);
echo "\n";
} catch ( myException $e ) {
fprintf (STDERR, "%s\n", $e->Message ());
#print_r ($e);
#print_r ($e->Trace ());
#echo $e->TraceAsString () . "\n";
print_r ($e->TraceAsArray ()) . "\n";
$e->finalize ();
}
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: set filetype=php noet sw=4 ts=4 fdm=marker:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/
?>
Installation:
이 패키지는 oops/myException 패키지에 의존성이 있습니다. 그러므로 아래의 pear 명령을 이용하여 설치하는 것을 권장 합니다.
shell> pear channel-discover pear.oops.org shell> pear install oops/MTA shell> pear list -a