Swiftmailer sending PDF

江枫思渺然 提交于 2019-12-13 16:09:40

问题


I'm using Swiftmailer to send PDFs

I keep receiving this error

ErrorException

fopen(Content-Type: application/pdf; name=53746a9ee9e85SellingAgreement.pdf Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=53746a9ee9e85SellingAgreement.pdf JVBERi0xLjUNCiW1tbW1DQoxIDAgb2JqDQo8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFIvTGFuyhlbi1BVSkgPj4NCmVuZG9iag0KMiAwIG9iag0KPDwvVHlwZS9QYWdlcy9Db3VudCAxNi9LaWRzWyAzIDAgUiAxNSAwIFIgMjggMCBSIDM2IDAgUiA0OSAwIFIgNTMgMCBSIDU1IDAgUiA1NyAwIFIgNjEgMCBSIDY1IDAgUiA2OSAwIFIgNzMgMCBSIDc3IDAgUiA4MSAwIFIgODUgMCBSIDg5IDAgUl0gPj4NCmVuZG9iag0KMyAwIG9iag0KPDwvVHlwZS9QYWdlL1BhcmVudCAyIDAgUi9SZXNvdXJjZXM8PC9Gb250PDwvRjEgNSAwIFIvRjIgNyAwIFIvRjMgOSAwIFI+Pi9YT2JqZWN0PDwvSW1hZ2UxNCAxNCAwIFI+Pi9Qcm9jU2V0Wy9QREYvVGV4dC9JbWFnZUIvSW1hZ2VDL0ltYWdlSV0gPj4vTWVkaWFCb3hbIDAgMCA1OTUuMzIgODQxLjkyXSAvQ29udGVudHMgNCAwIFIvR3JvdXA8PC9UeXBlL0dyb3Vw

This is my swift code

  $message->to($star)
     ->subject($name." has contacted you on https://seek.estate")
     ->attach(Swift_Attachment::fromPath('assets/docs/'.$attachment));

in my php.ini I have upload_max_filesize

post_max_size = 120M allow_url_fopen =on

Not sure what could be causing this error. Thanks in advance.

来源:https://stackoverflow.com/questions/23910407/swiftmailer-sending-pdf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!