Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Php mail script is not capable to send out HTML

Discussion in 'E-mail Discussion' started by Emiliano, Jun 6, 2014.

  1. Emiliano

    Emiliano Active Member

    Joined:
    May 13, 2011
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    56
    Location:
    Orlando, Florida, United States
    Hello,
    Thank you in advanced for your help.

    I had a domain on godaddy shared hosting and i had installed a php script that looks like this...
    Code:
    ------------------------------------------------------------------------------------
    <?php
        $to      = 'info@domain.com';
        $subject = "Test Email";
        $headers = "Content-Type: text/html; charset=UTF-8";
    
        // This one works because it is plain
        // $headers = "Content-Type: text/plain; charset=UTF-8";
    
        // If you set it to text/plain, all messages will work
        $message_working_1 = "test somesite.com test";
        $message_working_2 = "test somesite.com-different-domain.com test";
        $message_not_working = "test somesite.com test";
    
        mail($to, $subject, $message_working_1, $headers));
    ---------------------------------------------------------------------------------------------------------
    Now on godaddy shared it did not work out, so i was thinking there might be something wrong with te server. I moved it all to my VPS and the very same issue persists.

    I have tried many things but to this moment I have not been able to send HTM Content emails.
    Please, help!
    ThAnk you
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    Could you clarify what in particular is not working? For instance, is the email sending out at all, or is it sending and not using the correct format?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice