Title: send attachment
Last modified: August 21, 2016

---

# send attachment

 *  Resolved [yab1986](https://wordpress.org/support/users/yab1986/)
 * (@yab1986)
 * [12 years ago](https://wordpress.org/support/topic/send-attachment/)
 * Hi guys
 * Is there a way to send an attachment with the wp better mail.
 * On a site I have following code:
 *     ```
       $mail = $mail[1];
       $attachments = array( WP_CONTENT_DIR . '/uploads/'.$object.'.pdf' );
       $content = 'Hello and welcome';
       wp_mail( $mail, 'Versand Verkaufsexposé', $content, $attachments );
       ```
   
 * On the wp better mail I have following:
    `%content%`
 * Everything works, but the attachment is not send. 🙁
 * Any help?
 * Greets, yab1986
 * [https://wordpress.org/plugins/wp-better-emails/](https://wordpress.org/plugins/wp-better-emails/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Nicolas Lemoine](https://wordpress.org/support/users/nlemoine/)
 * (@nlemoine)
 * [12 years ago](https://wordpress.org/support/topic/send-attachment/#post-4827215)
 * Hi yab1986,
 * The plugin isn’t involved in your issue. Have a look at the wp_mail function:
   [http://codex.wordpress.org/Function_Reference/wp_mail](http://codex.wordpress.org/Function_Reference/wp_mail)
 * The attachments argument is the fifth one, not the fourth. You’re passing attachments
   as the “headers” argument.
 *     ```
       $mail = $mail[1];
       $attachments = array( WP_CONTENT_DIR . '/uploads/'.$object.'.pdf' );
       $content = 'Hello and welcome';
       wp_mail( $mail, 'Versand Verkaufsexposé', $content, '', $attachments );
       ```
   
 *  Thread Starter [yab1986](https://wordpress.org/support/users/yab1986/)
 * (@yab1986)
 * [12 years ago](https://wordpress.org/support/topic/send-attachment/#post-4827217)
 * Perfect. That works. 🙂 Thanks a lot!!!
 *  [rswai](https://wordpress.org/support/users/rswai/)
 * (@rswai)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/send-attachment/#post-4827538)
 * Hi, could someone explain to me what the problem with mine might be? I can send
   mail but with no attachments…I have two files, wp-mail.php and wp_mail_smtp.php(
   from the plugin) which is the one that is executed BUT I’ve been through numerous
   posts and each one talks about adding the $attachments parameter to the function
   in wp-mail…I don’t even have that function in wp-mail though, my wp-mail file
   doesn’t seem to relate to any of this! Could you help me on this?
 * I’m on localhost.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘send attachment’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-better-emails_f6f6f6.svg)
 * [WP Better Emails](https://wordpress.org/plugins/wp-better-emails/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-better-emails/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-better-emails/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-better-emails/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-better-emails/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-better-emails/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [rswai](https://wordpress.org/support/users/rswai/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/send-attachment/#post-4827538)
 * Status: resolved