1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

HTML in Emails

Discussion in 'Plesk for Linux - 8.x and Older' started by RavSS, Mar 6, 2005.

  1. RavSS

    RavSS Guest

    0
     
    All in plesk seems to working fine..except for email from php.

    The scipt remains untouched and worked fine on another plesk box, now for some reason all HTML is shown in the email and webmail shows the mail as an attatchment.

    Cant find any settings for this in plesk.
     
  2. RavSS

    RavSS Guest

    0
     
    Very odd.. even a full reinstall will not resolve this issue..

    Mails from webmail work fine.. but from php they dont.. plesk tech support have test the script we use and it works fine for them..

    any help would be great.
     
  3. RavSS

    RavSS Guest

    0
     
    Turns out that \r in the script caused all the problems ... very annoying.
     
  4. Pagemakers

    Pagemakers Silver Pleskian

    31
    80%
    Joined:
    Dec 19, 2007
    Messages:
    664
    Likes Received:
    7
    /home/httpd/vhosts/webmail/horde/imp/config/mime_drivers.php

    $mime_drivers['imp']['html']['inline'] = false; to true
     
  5. cvgeldern

    cvgeldern Guest

    0
     
    same problem here, so what to do with the \r ?
     
  6. RavSS

    RavSS Guest

    0
     
    removed it from the script and all worked fine.
     
  7. cvgeldern

    cvgeldern Guest

    0
     
    i already figured that one out ;)

    but thanks anyway, it works for me here
     
  8. jgaris

    jgaris Guest

    0
     
    I am having a similar problem...

    When using IMP webmail, all HTML emails display the entire HTML code in the body of the email, instead of rendering it.

    I enabled inline HTML in mime_drivers.php, but still no resolve. What script are talking about with the /r in it?

    Does any body knowwhat could be happening?

    Thanks.
     
  9. bdmcnitt

    bdmcnitt Guest

    0
     
    I am experiencing the same problem as RavSS. It appears there is a misconfiguration with PHP and the mail server in the latest Plesk update - 7.5.3. As RavSS states, this is a new problem. PHP/HTML email worked fine in prior Plesk releases. Using the \r in PHP email headers is standard practice (please see the php manual - http://us3.php.net/manual/en/function.mail.php). Removing \r could cause problems if the script is used on a properly configured server or if Plesk fixes this issue in the future.

    I have not yet tried the $mime_drivers update that Pagemakers suggests but by cvgeldern's post it does not seem to be a root solution. Has anyone else found a fix for this issue?

    Sample PHP/HTML email script that *should* work but doesn't:

    PHP:
    <?php
       $to 
    "You <you@example.com>";
       
    $from "Us <us@example.com>";
       
    $subject "HTML E-mail test";
       
    $message="<h1>HTML E-mail</h1>";
       
    $headers 'MIME-Version: 1.0' "\r\n";
       
    $headers.= 'Content-type: text/html; charset=iso-8859-1' "\r\n";
       
    $headers.= "From: $from"\r\n";
       if (
    mail($to$subject$message$headers))
          echo 
    "Message Sent!";
       else
          echo 
    "Failed to send message.";
    ?>
     
  10. serial-thrilla

    serial-thrilla Guest

    0
     
    so any email that is sent with mail() via php does not send? or am i not understanding what is the problem...

    no error messages?
     
  11. bdmcnitt

    bdmcnitt Guest

    0
     
    Mail sent via PHP mail() is sent without error but comes through as plain text. All headers are ignored and appear in the body of the email along with the raw HTML code.
     
  12. serial-thrilla

    serial-thrilla Guest

    0
     
    oh, and you are setting "Content-type: text/html\r\n" ?
     
  13. bdmcnitt

    bdmcnitt Guest

    0
     
    Yes. (Sorry, my prior post did not reflect the correct code. Please see revised PHP code above. Thanks!)
     
  14. bdmcnitt

    bdmcnitt Guest

    0
     
    we made a chage to:

    /etc/psa-horde/imp/mime_drivers.php

    $mime_drivers['imp']['html']['inline'] = false; to true

    per Pagemakers post. It now works in Hotmail...but not Outlook or Gmail...so there continues to be a misconfiguration somewhere. (I assume Hotmail looks for HTML coding or is forgiving with misformatted headers, etc.) Very strange. The above PHP syntax is correct per the PHP manual and works on our other servers and hosted accounts. Any other suggestions?
     
  15. serial-thrilla

    serial-thrilla Guest

    0
     
    just a random shot, but does the php.ini have "sendmail_path = /usr/sbin/sendmail -t -i" ?
     
  16. bdmcnitt

    bdmcnitt Guest

    0
     
    Yes.
     
  17. maarten

    maarten Guest

    0
     
    php sendmail changed

    We have the same problem overhere. All mailscripts that used to work before are not working anymore. Is there a global setting we can do? My php.ini is still showing

    sendmail_path = /usr/sbin/sendmail -t -i

    So that is still correct.

    Changing the various scripts is not an option, we have over 300 domains on this server.
     
  18. bdmcnitt

    bdmcnitt Guest

    0
     
    I don't believe we ever found a solution. I will be interested to know what you find out.
     
  19. cvgeldern

    cvgeldern Guest

    0
     
    For us removing the \r from any variable in the mailscripts did work perfectly.

    So subject, header etc. should be verified for having \r for end of lines.
     
  20. bdmcnitt

    bdmcnitt Guest

    0
     
    agree that removing /r lines works, but it's a workaround. r/ lines are legal in php and worked in past plesk releases. this is a bug introduced in the latest plesk release and one swsoft needs to address.
     
Loading...