Send Mails from word press using wp_mail() with attachment

Send Mails from word press using wp_mail() with attachment
define('WP_CONTENT_DIR', '/var/www/html/learning-hub/wp-content/');
$headers[] = 'Content-Type: text/html; charset=UTF-8';
$headers[] = 'From: Learning Hub <'.get_option('admin_email').'>' . "\r\n";
$attachments = array( WP_CONTENT_DIR .'/uploads/pdf/946.pdf' );
wp_mail( $customeremail, 'Learning Hub Order:'.$order_id,$messege,$headers,$attachments);

screen45

Leave a Reply

Your email address will not be published. Required fields are marked *