Current Path : /compat/linux/proc/68247/root/compat/linux/proc/68247/root/compat/linux/proc/68247/cwd/usr/opt/php72/share/pear/doc/Mail_Mime/scripts/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //compat/linux/proc/68247/root/compat/linux/proc/68247/root/compat/linux/proc/68247/cwd/usr/opt/php72/share/pear/doc/Mail_Mime/scripts/phail.php |
#!@prefix@/bin/php -Cq <?php /** * PHAIL - stands for PHP Mail * @author Tomas V.V.Cox <cox@idecnet.com> */ require_once 'Mail.php'; require_once 'Mail/mime.php'; require_once 'Console/Getopt.php'; $argv = Console_Getopt::readPHPArgv(); $opts = Console_Getopt::getOpt($argv, 'f:c:s:t:a:b:'); if (PEAR::isError($opts)) { usage($opts->getMessage()); } PEAR::setErrorHandling(PEAR_ERROR_DIE); $mime = new Mail_mime; foreach ($opts[0] as $opt) { $param = $opt[1]; switch ($opt[0]) { case 'f': $headers['From'] = $param; break; case 'c': $headers['Cc'] = $param; break; case 's': $headers['Subject'] = $param; break; case 't': $to = $param; break; case 'a': $mime->addAttachment($param); break; case 'b': $isfile = @is_file($param) ? true : false; $mime->setTXTBody($param, $isfile); break; } } $mbody = $mime->get(); $headers = $mime->headers($headers); $mail = Mail::factory('mail'); $mail->send($to, $headers, $mbody); function usage($error) { die($error); } ?>