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)