Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to send attachment in Wordpress email

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 156
    Comment on it

    Hello Friends,

    If you are looking to send attachment in wordpress email. Please follow the below example for the same:

    $to = 'sender@email.com'; 
    $subject = 'Define your email subject';
    
    // Define your email body
    $body = 'Define your email body';
    
    // Define attachment file path
    $attachment = array( WP_CONTENT_DIR . '/path/to/your/attachment_file.zip' );
    
    //Define your header
    $headers = array('Content-Type: text/html; charset=UTF-8');
    
    // Send Email
    wp_mail( $to, $subject, $body, $headers, $attachment); 
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: