reioto/zend-mailj

Zend Mail for Japanese

1.0.1 2015-03-19 02:37 UTC

This package is not auto-updated.

Last update: 2024-04-13 13:09:45 UTC


README

Zend Mail でISO-2022-JPのメールを送れるようにしたラップクラスです。

Installation

composer

composer.json
{
    "require": {
        "reioto/zend-mailj":"dev-master"
    }
}

#php composer.phar install

Usage

function recipientFilename($transport)
{
    return $transport->recipients . '_' . mt_rand() . '.tmp';
}
$tr = new Zend_Mail_Transport_File(array('callback' => 'recipientFilename',
                                         'path' => dirname(__FILE__)
                                         ));
$mail = new Zend_MailJ();
$mail->setFrom('from@example.com', '差出人名');
$mail->addTo('to@example.com', '宛名');
$mail->setSubject('件名です。件名です。件名です。件名です。');
$mail->setBodyText('メール本文');
$mail->send($tr);