Mail::pushAttached
ファイルを添付します
説明
public self Mail::pushAttached( string $filePath, [ string $fileName = null ] )
$filePathのファイルがなければ、何も追加しません。添付ファイルはMail::sendで一緒に送ります。
引数
| 名前 | データ型 | デフォルト | 備考 |
|---|---|---|---|
| $filePath | string | 添付ファイルのパス | |
| $fileName | string | null | メールに表示するファイル名。省略すると$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');