php formatted html shows up in Yahoo mail but not gmail

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cybervigilante

    php formatted html shows up in Yahoo mail but not gmail

    I sent HTML formatted email, using PHP, to my Yahoo address from my
    server, and it came out fine, styles and all. I sent it to my gmail
    address to test it and all I see is the raw html code. But I do get
    formatted email in gmail, so I know people make it work somehow. I'm
    looking right at a gmail message that I copied to Dreamweaver and it's
    using Strong and Red text attributes that work in gmail. But mine
    don't.

    What do you do different in gmail to get formatted HTML email?

    Here is my PHP code, which Does receive correctly, with color and
    formatting, in Yahoo mail, but not gmail.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html lang="en">
    <head>
    <title>PHP Guestbook</title>
    </head>
    <body>

    <h1>mailtest</h1>


    <?php

    $headers = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

    $msg = "<h2 style='color:re d; background-color: Fuchsia; border: thick
    dotted; border-color: Blue; font-family: sans-serif; font-style:
    italic; margin-left: 20%; padding: 20; margin-right: 30%;'>Test of
    formatted email from <br>Just Health Now server, with html headers</
    h2>";
    echo ($msg);

    mail("seren37@y ahoo.com","no damn color",$msg,$he aders);


    ?>


    </body>
    </html>

  • Benjamin

    #2
    Re: php formatted html shows up in Yahoo mail but not gmail

    On Apr 29, 8:31 pm, cybervigilante <cybervigila... @gmail.comwrote :
    I sent HTML formatted email, using PHP, to my Yahoo address from my
    server, and it came out fine, styles and all. I sent it to my gmail
    address to test it and all I see is the raw html code. But I do get
    formatted email in gmail, so I know people make it work somehow. I'm
    looking right at a gmail message that I copied to Dreamweaver and it's
    using Strong and Red text attributes that work in gmail. But mine
    don't.
    >
    What do you do different in gmail to get formatted HTML email?
    In order to reduce confusion, Gmail may display HTML in plain text.
    >
    Here is my PHP code, which Does receive correctly, with color and
    formatting, in Yahoo mail, but not gmail.
    >
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html lang="en">
    <head>
    <title>PHP Guestbook</title>
    </head>
    <body>
    >
    <h1>mailtest</h1>
    >
    <?php
    >
    $headers = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    >
    $msg = "<h2 style='color:re d; background-color: Fuchsia; border: thick
    dotted; border-color: Blue; font-family: sans-serif; font-style:
    italic; margin-left: 20%; padding: 20; margin-right: 30%;'>Test of
    formatted email from <br>Just Health Now server, with html headers</
    h2>";
    echo ($msg);
    >
    mail("sere...@y ahoo.com","no damn color",$msg,$he aders);
    >
    ?>
    >
    </body>
    </html>

    Comment

    • Manuel Lemos

      #3
      Re: php formatted html shows up in Yahoo mail but not gmail

      Hello,

      on 04/29/2007 10:31 PM cybervigilante said the following:
      I sent HTML formatted email, using PHP, to my Yahoo address from my
      server, and it came out fine, styles and all. I sent it to my gmail
      address to test it and all I see is the raw html code. But I do get
      formatted email in gmail, so I know people make it work somehow. I'm
      looking right at a gmail message that I copied to Dreamweaver and it's
      using Strong and Red text attributes that work in gmail. But mine
      don't.
      >
      What do you do different in gmail to get formatted HTML email?
      You should not send HTML mail messages with a plain text alternative
      part. When you do that, mail systems may take it as a sign of spam, as
      real mail programs do not send messages that way.

      You should compose a multipart/alternative message that contains a text
      part and an HTML mail part.

      If you do not know how to do that, take a look at this MIME message
      class as it makes that task much simpler. Try the
      test_simple_htm l_mail_message. php script.




      --

      Regards,
      Manuel Lemos

      Metastorage - Data object relational mapping layer generator


      PHP Classes - Free ready to use OOP components written in PHP
      Free PHP Classes and Objects 2026 Versions with PHP Example Scripts, PHP Tutorials, Download PHP Scripts, PHP articles, Remote PHP Jobs, Hire PHP Developers, PHP Book Reviews, PHP Language OOP Materials

      Comment

      • Jerry Stuckle

        #4
        Re: php formatted html shows up in Yahoo mail but not gmail

        Manuel Lemos wrote:
        Hello,
        >
        on 04/29/2007 10:31 PM cybervigilante said the following:
        >I sent HTML formatted email, using PHP, to my Yahoo address from my
        >server, and it came out fine, styles and all. I sent it to my gmail
        >address to test it and all I see is the raw html code. But I do get
        >formatted email in gmail, so I know people make it work somehow. I'm
        >looking right at a gmail message that I copied to Dreamweaver and it's
        >using Strong and Red text attributes that work in gmail. But mine
        >don't.
        >>
        >What do you do different in gmail to get formatted HTML email?
        >
        You should not send HTML mail messages with a plain text alternative
        part. When you do that, mail systems may take it as a sign of spam, as
        real mail programs do not send messages that way.
        >
        You should compose a multipart/alternative message that contains a text
        part and an HTML mail part.
        >
        If you do not know how to do that, take a look at this MIME message
        class as it makes that task much simpler. Try the
        test_simple_htm l_mail_message. php script.
        >

        >
        >
        Actually, you NEED to send both HTML and plain text. Otherwise people
        who accept only plain text will not receive it. Any mail with special
        encodings (such as HTML) should include a plain text version.

        But did you also indicate the content was multi-part, including both
        text and text/html content? Did it have the appropriate separators?


        --
        =============== ===
        Remove the "x" from my email address
        Jerry Stuckle
        JDS Computer Training Corp.
        jstucklex@attgl obal.net
        =============== ===

        Comment

        • Geoff Berrow

          #5
          Re: php formatted html shows up in Yahoo mail but not gmail

          Message-ID: <46354B3D.60802 06@acm.orgfrom Manuel Lemos contained the
          following:
          >What do you do different in gmail to get formatted HTML email?
          >
          >You should not send HTML mail messages with a plain text alternative
          >part. When you do that, mail systems may take it as a sign of spam, as
          >real mail programs do not send messages that way.
          s/with/without
          --
          Geoff Berrow (put thecat out to email)
          It's only Usenet, no one dies.
          My opinions, not the committee's, mine.
          Simple RFDs http://www.ckdog.co.uk/rfdmaker/

          Comment

          Working...