Title: Fatal Error: Plugin uses HTML content as filename &#8211; causes 500 error on form sub
Last modified: February 9, 2026

---

# Fatal Error: Plugin uses HTML content as filename – causes 500 error on form sub

 *  [simsekabdurrahman](https://wordpress.org/support/users/simsekabdurrahman/)
 * (@simsekabdurrahman)
 * [2 months, 3 weeks ago](https://wordpress.org/support/topic/fatal-error-plugin-uses-html-content-as-filename-causes-500-error-on-form-sub/)
 * Hi,
 * I’m experiencing a PHP Fatal Error caused by your plugin that completely
   breaks
   Contact Form 7 submissions, returning a 500 Internal Server Error.
 * **Environment:**
    - WordPress: 6.7.x
    - PHP: 8.x
    - Contact Form 7: Latest version
    - Generate PDF Using Contact Form 7: Latest version
    - Hosting: Shared hosting (GoDaddy)
 * **The Problem:**
 * When a visitor submits a CF7 form, the plugin crashes with the following
   fatal
   error, preventing the form from being submitted entirely:
 * PHP Fatal error: Uncaught Mpdf\MpdfException: Unable to create output file
   /home/
   customer/www/example.com/public_html/wp-content/plugins/generate-pdf-using-contact-
   form-7/attachments/
 * **Root Cause:**
 * It appears the plugin is using the **raw HTML content of the email body as part
   of the PDF filename** instead of generating a proper sanitized
   filename. This
   creates an invalid file path containing HTML tags like`<p>`, `<style>`, etc.,
   which the filesystem cannot handle.
 * The error occurs at:
    - File: `generate-pdf-using-contact-form-7/inc/lib/mpdf/vendor/mpdf/mpdf/src/
      Mpdf.php` (line 9609)
    - Called from: `generate-pdf-using-contact-form-7/inc/front/class.cf7-pdf-generation.
      front.action.php` (line 387)
 * **Stack trace confirms** the issue happens during the `wpcf7_before_send_mail`
   
   hook when the plugin tries to generate the PDF attachment.
 * **Expected Behavior:**
   The plugin should generate a sanitized filename (e.g.,`
   form-submission-1770619321-0187.pdf`)instead of using HTML content as the filename.
 * **Temporary Workaround:**
   I had to deactivate the plugin entirely to restore 
   form functionality.
 * **Steps to Reproduce:**
    1. Install and activate the plugin
    2. Configure it with any CF7 form
    3. Submit the form from the frontend
    4. Form submission fails with 500 error
 * Could you please look into this filename generation bug? It seems like a
   critical
   issue that would affect all users.
 * Thank you for your time.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffatal-error-plugin-uses-html-content-as-filename-causes-500-error-on-form-sub%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  [Cristopher](https://wordpress.org/support/users/cristopherzwt/)
 * (@cristopherzwt)
 * [1 month, 2 weeks ago](https://wordpress.org/support/topic/fatal-error-plugin-uses-html-content-as-filename-causes-500-error-on-form-sub/#post-18855087)
 * Hello [@simsekabdurrahman](https://wordpress.org/support/users/simsekabdurrahman/)
 * Thank you very much for providing this information regarding the bug.
 * We plan to resolve this issue in the next version of the plugin.
 * Thank you for your patience and support.
   Thank you,Zealousweb

Viewing 1 replies (of 1 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffatal-error-plugin-uses-html-content-as-filename-causes-500-error-on-form-sub%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/generate-pdf-using-contact-form-7/assets/icon-256x256.jpg?
   rev=3240636)
 * [Generate PDF using Contact Form 7](https://wordpress.org/plugins/generate-pdf-using-contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/generate-pdf-using-contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/generate-pdf-using-contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/generate-pdf-using-contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/generate-pdf-using-contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/generate-pdf-using-contact-form-7/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Cristopher](https://wordpress.org/support/users/cristopherzwt/)
 * Last activity: [1 month, 2 weeks ago](https://wordpress.org/support/topic/fatal-error-plugin-uses-html-content-as-filename-causes-500-error-on-form-sub/#post-18855087)
 * Status: not a support question