我試圖將一個字符串附加爲純文本文件,以迅速郵件消息中doc解釋說:斯威夫特梅勒動態文本Attachement
$debug_data = 'Exception: ' . $e_message . PHP_EOL;
$debug_data .= $file . ': ' . $line . PHP_EOL;
$debug_data .= $trace;
$attach = Swift_Attachment::newInstance($debug_data, 'debug.txt', 'text/plain');
$message->attach($attach);
,但是這給了我這個錯誤:
Error in exception handler: fopen(Content-Type: text/plain; name=debug.txt Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=debug.txt 1ay9wdWJsaWMvaW5kZXgucGhwKDQ5KTog SWxsdW1pbmF0ZVxGb3VuZGF0aW9uXEFwcGxpY2F0aW9uLT5ydW4oKQojMTMge21haW59): failed to open stream: No such file or directory in /vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/FileByteStream.php:138
有什麼想法?
它會告訴你......'沒有這樣的文件或目錄在/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/FileByteStream.php:138' – SeanWM
@SeanWM它沒有意義,因爲我沒有文件,我正在做附件。 – Amir