I want data submitted through Contact Form 7 to be sent as an attachment as opposed to text / html inside the email body.

Specifically I want this attachment to be in CSV format, which should be relatively straight forward to format based on the contact form 7 fields, but this depends upon whether it is possible to place this text into an attachment.

Is this possible? Thank you.

closed as off-topic by fuxia Jul 28 '14 at 7:46

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

  • Not sure why this is considered off topic. The solution to this problem is very specific to Wordpress. If someone re-opens this question I can post the solution to the answer. – greatwitenorth Jul 19 '18 at 16:42

Without any coding you can use the Contact Form 7 to Database Extension plugin which has the ability to export the posted data as CSV.

And if you are up for some coding then you can hook the wpcf7_before_send_mail action hook with your own function to create the csv form the $_POST data and sent it.

  • 3
    Thank you, I used the wpcf7_before_send_mail action hook, along with the fputcsv php function and it worked nicely :) – Josh Sep 9 '12 at 13:31
  • 1
    @Josh know this is an oldie, but I'm now looking to do something similar. Care to share your implementation? – rambillo Mar 18 '17 at 19:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.