How to attach PDF to email using PHP mail function

前端 未结 3 1292
栀梦
栀梦 2020-12-29 08:46

I am sending an email using PHP mail function, but I would like to add a specified PDF file as a file attachment to the email. How would I do that?

Here is my curren

3条回答
  •  无人及你
    2020-12-29 09:16

    To eliminate deprecation errors,

    Replace

    $body             = eregi_replace("[\]",'',$body);
    

    With

    $body             = preg_replace('/\.([^\.]*$)/i','',$body);
    

提交回复
热议问题