Php mail() MIME shows cleartext headers

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

    #1

    Php mail() MIME shows cleartext headers

    I am struggling with the php mail function so to allow a multipart mime
    settings where both the message and any set of attachments can be
    allowed.
    Teorically, I'd know how to do. I build up my headers and pass them as
    the fourth argument of the function mail().


    Practically, what happens is that whenever I try to test my script
    emailing myself, what appears in the email body are the __cleartext__
    headers.


    ùMaybe you spot in them something wrong, this is what in an email body
    appears (and should not) in cleartext:
    ==============
    MIME-Version: 1.0


    Content-Type: multipart/alternative;
    boundary="bound ary1650b42c9440 ­a87e70180d8f1c 1189b4";


    Content-Transfer-Encoding: quoted-printable


    This is a MIME encoded message


    --boundary1650b42 c9440a87e7018­0 d8f1c1189b4


    Content-Type: text/plain; charset="iso-8859-1"


    Content-Transfer-Encoding: quoted-printable


    type your message here


    --boundary1650b42 c9440a87e7018­0 d8f1c1189b4--
    ============


    please note that with
    Content-Type: multipart/mixed;
    or that with
    Content-Transfer-Encoding: 7bit
    nothing would change, all would still appear cleartext in the email
    body (testing both eudora and outlook).


    tia
    Alberto



  • Alvaro G Vicario

    #2
    Re: Php mail() MIME shows cleartext headers

    *** Alberto wrote/escribió (Tue, 17 May 2005 11:33:35 GMT):[color=blue]
    > Teorically, I'd know how to do. I build up my headers and pass them as
    > the fourth argument of the function mail().[/color]

    I've never tried myself but I suppose you just need to create headers for
    the first attachment. The headers for the rest of them are embedded in
    message body.


    --
    -- Álvaro G. Vicario - Burgos, Spain
    -- http://bits.demogracia.com - Mi sitio sobre programación web
    -- Don't e-mail me your questions, post them to the group
    --

    Comment

    • Alberto

      #3
      Re: Php mail() MIME shows cleartext headers

      Nope it doesn't work.
      Anyone has the url of a decent tutorial abou it? i do not need the
      application, I need to understand how it works. Hoever I add headers, they
      show up cleartext!
      tia


      "Alvaro G Vicario" <alvaro_QUITAR_ REMOVE@telecomp uteronline.com> ha scritto
      nel messaggio news:1e8p8y7ane 5cm.1papu1ccbwa vt$.dlg@40tude. net...[color=blue]
      > *** Alberto wrote/escribió (Tue, 17 May 2005 11:33:35 GMT):[color=green]
      >> Teorically, I'd know how to do. I build up my headers and pass them as
      >> the fourth argument of the function mail().[/color]
      >
      > I've never tried myself but I suppose you just need to create headers for
      > the first attachment. The headers for the rest of them are embedded in
      > message body.
      >
      >
      > --
      > -- Álvaro G. Vicario - Burgos, Spain
      > -- http://bits.demogracia.com - Mi sitio sobre programación web
      > -- Don't e-mail me your questions, post them to the group
      > --[/color]


      Comment

      • Tim Roberts

        #4
        Re: Php mail() MIME shows cleartext headers

        "Alberto" <nospam@nospam. nospam> wrote:[color=blue]
        >
        >Nope it doesn't work.
        >Anyone has the url of a decent tutorial abou it? i do not need the
        >application, I need to understand how it works. Hoever I add headers, they
        >show up cleartext![/color]

        The message headers passed to the API need to say:

        MIME-Version: 1.0
        Content-Type: multipart/alternative;
        boundary="bound ary1650b42c9440 ­a87e70180d8f1c 1189b4"
        Content-Transfer-Encoding: quoted-printable

        EVERYTHING else, including the "This message is MIME encoded" warning, the
        boundary markers, and the individual subpart headers, are just part of the
        message body. To the e-mail system, they are just text.
        --
        - Tim Roberts, timr@probo.com
        Providenza & Boekelheide, Inc.

        Comment

        • Jerry Stuckle

          #5
          Re: Php mail() MIME shows cleartext headers

          Alberto wrote:[color=blue]
          > I am struggling with the php mail function so to allow a multipart mime
          > settings where both the message and any set of attachments can be
          > allowed.
          > Teorically, I'd know how to do. I build up my headers and pass them as
          > the fourth argument of the function mail().
          >
          >
          > Practically, what happens is that whenever I try to test my script
          > emailing myself, what appears in the email body are the __cleartext__
          > headers.
          >
          >
          > ùMaybe you spot in them something wrong, this is what in an email body
          > appears (and should not) in cleartext:
          > ==============
          > MIME-Version: 1.0
          >
          >
          > Content-Type: multipart/alternative;
          > boundary="bound ary1650b42c9440 ­a87e70180d8f1c 1189b4";
          >
          >
          > Content-Transfer-Encoding: quoted-printable
          >
          >
          > This is a MIME encoded message
          >
          >
          > --boundary1650b42 c9440a87e7018­0 d8f1c1189b4
          >
          >
          > Content-Type: text/plain; charset="iso-8859-1"
          >
          >
          > Content-Transfer-Encoding: quoted-printable
          >
          >
          > type your message here
          >
          >
          > --boundary1650b42 c9440a87e7018­0 d8f1c1189b4--
          > ============
          >
          >
          > please note that with
          > Content-Type: multipart/mixed;
          > or that with
          > Content-Transfer-Encoding: 7bit
          > nothing would change, all would still appear cleartext in the email
          > body (testing both eudora and outlook).
          >
          >
          > tia
          > Alberto
          >
          >
          >[/color]
          Alberto,

          Your problem may be the blank lines between header lines. AFAIK, a
          blank line indicates the end of that particular header.

          Try sending yourself an email with similar attachments (they don't have
          to be identical) and look at the source for both the working and failing
          messages.

          Check your message header, also - ensure it's set up properly. If you
          still can't find anything, send me a failing message at the email below
          and I'll take a look at it.

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

          Comment

          Working...