Sending an attachment via Email(2)
-
On the page https://www.ads-software.com/support/topic/sending-an-attachment-using-contact-form-7?replies=6 I found code to send an attachment to someone that fills out a form.
I copied the code, configured it for the particular PDF file I want to send, and ran a test. The email arrives (both mail and mail(2)) but no attachment. The site is hosted on godaddy, and I am using the absolute path to the file.
The page is here:
https://labinsky.com/test/
This is the code that is currently in the file (functions.php):add_filter( ‘wpcf7_mail_components’, ‘mycustom_wpcf7_mail_components’ );
function mycustom_wpcf7_mail_components( $components ) {
$components[‘attachments’][] = ‘/home/content/l/a/b/labinsky/html/webroot/wp-content/uploads/FinancialGuide-Chapter08.pdf’;
return $components;
}
What can I do to get this to work?There was some another example to send a file here:
https://www.ads-software.com/support/topic/contact-form-7-sending-attachments-without-user-upload
I could not follow this example, and did not want to try because so many people wrote that the code was not working for them. Is there other code that works?Thank you.
- The topic ‘Sending an attachment via Email(2)’ is closed to new replies.