Using wp_mail with attachments but no attachments received

Posted by Prem Tiwari | Updated on

The $attachment argument for wp_mail takes a file (or array of files) – but the file path has to be fully specified. For example:

It seems that your $_POST['file'] is probably not specifying the full path. The attachment has to a file path, not an url. The following worked for me:

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@] Your question and answer will appear on and help other developers.

Related Questions & Answers