How to display image in mail header using wp_mail()

Question

How to display image in email header. I tried below, it in gmail it is not displaying the image. Please any one help me to resolve this. Thanks in advance.

    $to = $_REQUEST['userEmail'];
    $firstName = $_REQUEST['firstName'];
    $lastName = $_REQUEST['lastName'];
    $email = $_REQUEST['email'];
    $question = $_POST['message'];
    $subject = 'Test Email';
    $message = "<html><head><img src='http://192.168.1.157/Shop/wp-content/uploads/2016/07/image_nmae.png'/></head>"
            . "<body><h1>Visitor Information</h1>"
            . "<p>Visitor Information: Fist Name:&nbsp;&nbsp;".$firstName."&nbsp;&nbsp; Last Name:&nbsp;&nbsp; ".$lastName."</p>"
            . "<p>Email:&nbsp;&nbsp;".$email."</p><p>Question:&nbsp;&nbsp;".$question."</p></body></html>";
    $headers = array('Content-Type: text/html; charset=UTF-8');
    $mailSend = wp_mail($to, $subject, $message,$headers);
0
, Dinesh 4 years 2020-02-24T08:38:27-05:00 0 Answers 123 views 0

Leave an answer

Browse
Browse