Embedding images in email.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • miraan
    New Member
    • Apr 2008
    • 24

    Embedding images in email.

    Hi,
    I have been searching for hours, but I cant find a decent tutorial on how to embed an image in an email. All I want is to put a header image at the top of the email I am sending out, please can anyone help me on this? All help is greatly appreciated.
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, Miraan.

    It's reasonably easy with PHPMailer (http://phpmailer.codeworxtech.com/in...?pg=tutorial#4).

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      This is more of a theoretical idea at the moment, as IE seems to have a real problem with this concept, but..

      It is possible to embed image data directly into the HTML (assuming you are sending HTML emails).
      Like:
      [code=php]
      $data = file_get_conten ts("someimg.png ");
      $data = base64_encode($ data);
      echo '<img src="data:image/png;base64,', $data, '" alt="someimg" />';
      [/code]
      But, like I say, an email client that depends on IE to render HTML would not show this image.

      Comment

      • miraan
        New Member
        • Apr 2008
        • 24

        #4
        Thanks for all your help!

        Comment

        • pbmods
          Recognized Expert Expert
          • Apr 2007
          • 5821

          #5
          Originally posted by Atli
          But, like I say, an email client that depends on IE to render HTML would not show this image.
          Outlook 2003 uses IE to render HTML.
          Outlook 2007 uses Word (don't ask; you won't like the answer).

          Comment

          • Atli
            Recognized Expert Expert
            • Nov 2006
            • 5062

            #6
            Originally posted by pbmods
            Outlook 2003 uses IE to render HTML.
            Outlook 2007 uses Word (don't ask; you won't like the answer).
            Damn, now I'm curious :P

            Comment

            • pbmods
              Recognized Expert Expert
              • Apr 2007
              • 5821

              #7
              Originally posted by Atli
              Damn, now I'm curious :P
              Okay, you asked for it:

              Comment

              • Atli
                Recognized Expert Expert
                • Nov 2006
                • 5062

                #8
                Originally posted by pbmods
                You were right, I really don't like that.
                And to think, those... people pretty much control how we must design our webs.

                I foresee a huge army of angry web-developers tearing down the M$ headquarters.

                Comment

                • pbmods
                  Recognized Expert Expert
                  • Apr 2007
                  • 5821

                  #9
                  Originally posted by Atli
                  You were right, I really don't like that.
                  And to think, those... people pretty much control how we must design our webs.

                  I foresee a huge army of angry web-developers tearing down the M$ headquarters.
                  Meh. Microsoft gives their customers what they expect. What I'd really like to see is User re-education on a massive scale; if the people that give Microsoft money were to start demanding quality products in exchange, Microsoft would have to shape up or ship out.

                  I still haven't yet been able to determine the root of this problem, but there is something fundamentally wrong with a person who uses crappy software, acknowledges that it is crappy software... and then refuses to do anything to improve his situation and actively resists the efforts of others to do the same.

                  Comment

                  • Atli
                    Recognized Expert Expert
                    • Nov 2006
                    • 5062

                    #10
                    I would guess the problem is money. While Microsoft gets away with shipping crappy software, they will do so. It's cheaper than actually having to fix it.

                    Until they actually start loosing customers (or rather, money) because of this, they will only fix what is absolutely necessary and resist anything that will cost them extra.

                    Comment

                    • pbmods
                      Recognized Expert Expert
                      • Apr 2007
                      • 5821

                      #11
                      Originally posted by Atli
                      I would guess the problem is money. While Microsoft gets away with shipping crappy software, they will do so. It's cheaper than actually having to fix it.

                      Until they actually start loosing customers (or rather, money) because of this, they will only fix what is absolutely necessary and resist anything that will cost them extra.
                      I wish I had your support in the anti-Microsoft thread over in Software Development. I gave up after a couple of hours.

                      Comment

                      • pbmods
                        Recognized Expert Expert
                        • Apr 2007
                        • 5821

                        #12
                        At least we fixed the OP's problem before hijacking his thread O:)

                        Comment

                        Working...