メインコンテンツまでスキップ
Version: Fegg 5.x

Mail::pushAttached

ファイルを添付します

説明​

public self Mail::pushAttached( string $filePath, [ string $fileName = null ] )

$filePathのファイルがなければ、何も追加しません。添付ファイルはMail::sendで一緒に送ります。

引数​

名前データ型デフォルト備考
$filePathstring添付ファイルのパス
$fileNamestringnullメールに表示するファイル名。省略すると$filePathのファイル名

例​

Controller
use Fegg\Tool\Mail;

$mail = new Mail('Mail subject', 'Mail body');
$mail->pushAttached('path/to/file.pdf', 'document.pdf');
$mail->send('mail@example.com', 'John Doe', 'from@example.com');