• Hello, I contact you because the file uploaded via the form doesn’t appear in the email sent.

    Here is the code:

    [file file-684 limit:m3mb filetypes:image/*|txt|application/pdf id:idfoo class:classfile class:your-file class:classy2008 class:classm01 class:classd01]

    What’s the error?

    I’m using the last version v6.2

    Please help me. Thank you.

    Luca

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    We are also facing a similar problem since updating WordPress and CF7 recently. We have tried rolling back CF7 with no luck. I assume this must be a problem with WP 6.2.2. and CF7.

    We can successfully send attachments using wp_mail() as normal.

    There is a wp_mail() amend in the 6.2 field guide, regarding attachments. So I’m thinking this is quite likely to be a valid bug.

    Thread Starter lucascialo

    (@lucascialo)

    @takayukister thank you, but I already read this.

    Hi @jayshields1988, thank you. But I’m not an HTML expert. I may remove the email attachment field until the problem is finally resolved. Or try another Form…

    If you have CF DB 7 or Flamingo your file uploads will be stored in WP admin, so this isn’t a huge problem if that’s an acceptable way for you to view the files, rather than attachments on the email sent.

    I do think this is a bug somewhere in CF7 and/or WP though. I’ll wait for @takayukister to reply ??

    After much wasted time and research it seems this problem was introduced around 5.4.

    There is a check around line 230 of includes/mail.php to see if the attachment is within wp-content. This check will fail if you have a web host which splits some files (eg. uploads) out of wp-content and then symlinks the dir. (I have always done this and never had a problem.)

    Here is the IF check;

    if ( ! wpcf7_is_file_path_in_content_dir( $path ) ) {

    I’ve tried the WPCF7_UPLOADS_TMP_DIR config constant fix suggested elsewhere, no luck. (The docs actually state this must be under the wp-content dir, so it makes sense that this doesn’t work.)

    I have had to hard code the IF statement to false within the plugin to fix the issue.

    Hope this helps someone else.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Attached file doesn’t appear in the sent mail’ is closed to new replies.