wp_mail attachment
-
Hello,
I am building a contactpage, page-contact.php.
I have something more complex in mind but as a test, I tried to add an attachment to wp_mail and it doesn’t work. And that is my problem.The mail itself works fine but there simply isn’t an attachment. I use a simple text document, test.txt, that is located in the root of my there folder.
This is a simplified version of my code:
$headers = 'From: My Name <[email protected]>' . "\r\n"; $attachments = get_bloginfo('template_directory') . '/test.txt'; wp_mail( '[email protected]', 'testmail', 'This is a testmail', $headers, $attachments);Possible problems:
– path to attachment file is wrong
– $headers: content type is wrong
– attachment file is too small…?
– wrong setting in php.iniNone of these possibilities I have an answer to.
So here is my question: What am I doing wring or What could I be doing wrong?
The topic ‘wp_mail attachment’ is closed to new replies.