PHP Send email with PDF attachment without creating the file?

前端 未结 2 1852
太阳男子
太阳男子 2020-12-09 20:23

I generate PDF\'s using FPDF and I need to email it to a customer.

Since I can generate the PDF\'s from the DB, I don\'t want to save all the PDF\'s locally as it wi

2条回答
  •  甜味超标
    2020-12-09 21:25

    It's definitely possible. You could take any PHP mailer class that can handle attachments, and rewrite the addAttachment function where it reads data from file to accept your variable instead.

    Zend_Mail seems to be able to digest strings as attachments directly, without any rewriting.

提交回复
热议问题