天道酬勤,学无止境

file-generation

php create file and send as attachment without actually creating the file

I know how to read a file on the server and attach it to an email in PHP, but I wanted to know if I could attach a file that is created by my script but not created on the server (kinda like a temp file). So create file in memory and attach it to email. Bonus: might need to create multiple files as well, would this be too much for the server to handle? I'm not talking GB's but like 5 files with 1000 lines each?

2021-06-03 03:54:46    分类:问答    php   on-the-fly   email-attachments   file-generation