how to send a plain text version of an email with html

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

    how to send a plain text version of an email with html

    hi all

    how can u send a plain text version of an email with the html so that
    the users mail client can access this plain text version?

    kind regards

    marc

  • Erwin Moller

    #2
    Re: how to send a plain text version of an email with html

    monomaniac21 wrote:
    hi all
    >
    how can u send a plain text version of an email with the html so that
    the users mail client can access this plain text version?
    >
    kind regards
    >
    marc
    Simple: Make 2 versions.

    Or if you want to do it the very hard way: try to strip all html-tags.

    Regards,
    Erwin Moller

    Comment

    • monomaniac21

      #3
      Re: how to send a plain text version of an email with html

      Hi Erwin

      How does the email client know where the plain text version is located?

      Regards

      Marc

      Erwin Moller wrote:
      monomaniac21 wrote:
      >
      hi all

      how can u send a plain text version of an email with the html so that
      the users mail client can access this plain text version?

      kind regards

      marc
      >
      Simple: Make 2 versions.
      >
      Or if you want to do it the very hard way: try to strip all html-tags.
      >
      Regards,
      Erwin Moller

      Comment

      • Rik

        #4
        Re: how to send a plain text version of an email with html

        monomaniac21 wrote:
        Erwin Moller wrote:
        >monomaniac21 wrote:
        >>
        >>hi all
        >>>
        >>how can u send a plain text version of an email with the html so
        >>that the users mail client can access this plain text version?
        >>>
        >>kind regards
        >>>
        >>marc
        >>
        >Simple: Make 2 versions.
        >>
        >Or if you want to do it the very hard way: try to strip all
        >html-tags.
        >>
        How does the email client know where the plain text version is
        located?
        In a multipart email 2 versions are usually sent: the text en the HTML part.

        headers:
        MIME-Version: 1.0
        Content-Type: multipart/mixed; boundary="some_ random_string";

        before text:
        --some_random_str ing
        Content-Type: text/plain; charset="iso-8859-1"
        Content-Transfer-Encoding: 7bit

        before HTML:
        --some_random_str ing
        Content-Type: text/html; charset="iso-8859-1"
        Content-Transfer-Encoding: 7bit

        Where some_random_str ing remains the same throughout the mailobviously.
        Other charsets are offcourse possible.

        Grtz,
        --
        Rik Wasmus


        Comment

        • Kenneth Downs

          #5
          Re: how to send a plain text version of an email with html

          monomaniac21 wrote:
          hi all
          >
          how can u send a plain text version of an email with the html so that
          the users mail client can access this plain text version?
          >
          kind regards
          >
          marc
          Do you mean: How to send an email with an html part and a plaintext part, so
          that the mail client reads the appropriate version?

          This is not easy, but there are PEAR packages that make it about as easy as
          it can ever get. Start with PEAR Mail_Mime and PEAR Mail.

          --
          Kenneth Downs
          Secure Data Software, Inc.
          (Ken)nneth@(Sec )ure(Dat)a(.com )

          Comment

          • Chuck Anderson

            #6
            Re: how to send a plain text version of an email with html

            monomaniac21 wrote:
            hi all
            >
            how can u send a plain text version of an email with the html so that
            the users mail client can access this plain text version?
            >
            kind regards
            >
            marc
            >
            >
            Phpmailer makes this easy. You need to create both versions - HTML and
            plain text and then ...

            $mail->IsHTML(true) ; // set email format to HTML

            $mail->Body = "$html_body "; // HTML version
            $mail->AltBody = "$text_body "; // plain text version

            Phpmailer is easy to find >Gô¿ôgle

            --
            *************** **************
            Chuck Anderson • Boulder, CO

            *************** **************

            Comment

            • monomaniac21

              #7
              Re: how to send a plain text version of an email with html

              Thanks Chuck

              Nice site btw

              Chuck Anderson wrote:
              monomaniac21 wrote:
              hi all

              how can u send a plain text version of an email with the html so that
              the users mail client can access this plain text version?

              kind regards

              marc
              Phpmailer makes this easy. You need to create both versions - HTML and
              plain text and then ...
              >
              $mail->IsHTML(true) ; // set email format to HTML
              >
              $mail->Body = "$html_body "; // HTML version
              $mail->AltBody = "$text_body "; // plain text version
              >
              Phpmailer is easy to find >Gô¿ôgle
              >
              --
              *************** **************
              Chuck Anderson · Boulder, CO

              *************** **************

              Comment

              Working...