Hi,
Im trying to automatically send a file whenever someone fills the form and I came with this code from the creator of the plugin:
add_filter( 'wpcf7_mail_components', 'mycustom_wpcf7_mail_components' );
function mycustom_wpcf7_mail_components( $components ) {
$components['attachments'][] = 'wp-content/uploads/2012/11/Glosario-abierto-.pdf'';
return $components;
}
It doesn't work, though, with Contact Form 7 latest build. I get this error message:
add_filter( 'wpcf7_mail_components', 'mycustom_wpcf7_mail_components' ); function mycustom_wpcf7_mail_components( $components ) { $components['attachments'][] = 'http://www.website.com/files/testni.pdf'; return $components; }
Warning: Cannot modify header information - headers already sent by (output started at /home/expandir/public_html/wp-content/themes/ChildThemeTwentyEleven/functions.php:6) in /home/expandir/public_html/wp-includes/pluggable.php on line 881
What im doing wrong?
Thanks!!