plugins – wp-mail attachment is not sent for no reason?

Question

I’m using wp-mail to send an image. The problem is that it does not attach the image !

Here is $attachment_img string : https://example.com/wp-content/uploads/2021/10/example.jpg So the path is correct

Here is the function :

function send_mail_to_admin($orderId , $attachment_img){
    $headers = array('Content-Type: text/html; charset=UTF-8','From: انجمن آبزیان <info@seabou.com>');
    $body = "<html><body>
    <b style="font-size:14px;direction:rtl;text-align:center;">یک مشتری سفارش با شماره $orderId ثبت کرد</b>
    </body></html>"; 
    wp_mail( "nabestan98@gmail.com", "دریافت نامه کاربر", $body, $headers , array($attachment_img) );
}

0
game lover 2 weeks 2021-10-08T05:00:39-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse