How to send an attachment mail using wp_mail mail

17,804

Try this and let me know then --

$attachments = array(ABSPATH . '/uploads/abc.png');
wp_mail($email, 'Testing Attachment' , 'This is subscription','This is for header',$attachments);

Your attachment is setting as header in this case.

Share:
17,804
Shah Rukh
Author by

Shah Rukh

I am a Coder, Trying to be an all rounder in coding

Updated on June 08, 2022

Comments

  • Shah Rukh
    Shah Rukh about 2 years

    Is there anyone to tell me that how to send an attachment email using wp_mail function of wordpress? I am using the following code but its not working

    $attachments = array(ABSPATH . '/uploads/abc.png');
    wp_mail($email, 'Testing Attachment' , 'This is subscription',$attachments);
    

    Thanks