SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Thread: Html Email

  1. #1
    SitePoint Addict
    Join Date
    Apr 2002
    Location
    Miami
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Html Email

    Hi ,

    Im sure all have seen my previous post regarding html email. Well I finally got it working. In testing however I am finding that on a computer running xp and IE the encoding is not working. Instead of an image I get nothing but code.

    Does anybody know of any incompatabilities that would cause this. Do the headers have some different format or is it something to do with the preferences on the users computer.

    I really dont know where to begin on this one. I am using a class that includes a variable called html data. The images are just referenced they are not attached.

    Any ideas let me know, Also any voulonteers with different OS and platforms to receive an email let me know to I promisse it will have pretty girls in the body

  2. #2
    SitePoint Guru Richi's Avatar
    Join Date
    Jul 2001
    Location
    Hu,Bp.
    Posts
    842
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does anybody know of any incompatabilities that would cause this. Do the headers have some different format or is it something to do with the preferences on the users computer.
    i don`t think so, coz as i know mime reader is the same in all OS expet linux and unix, if the htm code is the same, the out put will be the same on win9x, windows x !

  3. #3
    SitePoint Addict
    Join Date
    Apr 2002
    Location
    Miami
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thats what I thought too but when I use this class I download from devshed it works fine on Mac + Netscape and IE but on my other computer windowsxp all I get is a garbled transmission.

    Anyway I solved the problem by adapting Kevin Yanks tutorial. It works fine now but thanks anyway.

    jp

  4. #4
    SitePoint Addict TegSkywalker's Avatar
    Join Date
    Nov 2001
    Location
    USA
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did you take a look at the PHP manual at http://www.php.net/manual/en/function.mail.php?

    You may want to take a look under the section where they talk about setting headers and so on. Ya know, setting the email as like text/html with a charset attribute and if it is 7 bit or quoted-printable.

  5. #5
    SitePoint Addict
    Join Date
    Apr 2002
    Location
    Miami
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks

    alot of good information there. I 'm gonna go back and read up.


    cheers

    jp

  6. #6
    SitePoint Addict
    Join Date
    Apr 2002
    Location
    Miami
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Im still having problems with this. I got basic images working but now I am trying to embed a flash document.

    It works in Mac+Netscape
    Windows xp shows all but the flash

    Do I have to stipulate special headers for
    flash content?

  7. #7
    SitePoint Addict TegSkywalker's Avatar
    Join Date
    Nov 2001
    Location
    USA
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by whiterabbit
    Im still having problems with this. I got basic images working but now I am trying to embed a flash document.

    It works in Mac+Netscape
    Windows xp shows all but the flash

    Do I have to stipulate special headers for
    flash content?
    In your actual body of the HTML message, did you put in the proper tags for embedding the Flash? The reason I ask this is because as of IE 5.5 SP2 and IE 6, Microsoft removed support for Netscape style plugins and want you to use ActiveX instead. Here is a sample bit of code I stole from Dreamweaver if you want to put in a default .swf movie that works in IE 4-6 and Netscape 4/6 for the PC/Mac:


    PHP Code:
    <object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\"30\" height=\"30\">
    <param name=\"movie\" value=\"movie.swf\">
    <param name=\"quality\" value=\"high\">
    <embed src=\"movie.swf\" quality=\"high\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"30\" height=\"30\">
    </embed> 
    </object> 
    See if you can throw that in your PHP script. Remember that this code has quotations so double check that it doesnt error out your code. ya know, like \" tags and all.

    P.S. For some reason in the above code snippet, the \" isn't showing up after the object classid attribute. Dunno if it is something with VBulletin, but throw one in anyways. Hehe I feel like an idiot editing this message going "why wont that slash show up!" but oh well :)
    Last edited by TegSkywalker; May 3, 2002 at 17:19.

  8. #8
    SitePoint Addict
    Join Date
    Apr 2002
    Location
    Miami
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I use Dreamweaver to embed so I dont think thats it.

    Could it be that I need to encode it as something other than base64 encoding. Right now my html content is in an include file asigned to a variable.

    The flash content is in this template as well.

    for the html I use the following code

    "--{$mime_boundary}\n" .
    "Content-Type: text/html;\n" .
    "Content_Type: application/x-shockwave-flash;\n" .
    "Content-Transfer-Encoding: base64\n\n" .
    $data . "\n\n" .
    "--{$mime_boundary}--\n";


    I tried it without specifying the swf type as well but doesnt seem to make any difference. Any ideas?

  9. #9
    SitePoint Addict TegSkywalker's Avatar
    Join Date
    Nov 2001
    Location
    USA
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by whiterabbit
    Hi,

    I use Dreamweaver to embed so I dont think thats it.

    Could it be that I need to encode it as something other than base64 encoding. Right now my html content is in an include file asigned to a variable.

    The flash content is in this template as well.

    for the html I use the following code

    "--{$mime_boundary}\n" .
    "Content-Type: text/html;\n" .
    "Content_Type: application/x-shockwave-flash;\n" .
    "Content-Transfer-Encoding: base64\n\n" .
    $data . "\n\n" .
    "--{$mime_boundary}--\n";


    I tried it without specifying the swf type as well but doesnt seem to make any difference. Any ideas?
    Try quoted-printable as your Content-Transfer-Encoding and see if that works

    P.S. I see two other things, but why are you setting both headers of your email as a text/html document AND a Shockwave Flash document? You should only need the text/html being sent out as the default and then use the application/x-shockwave-flash when it is embedded into your HTML document. This is important because email programs like Outlook rely on those headers.
    Last edited by TegSkywalker; May 3, 2002 at 17:27.

  10. #10
    SitePoint Addict
    Join Date
    Apr 2002
    Location
    Miami
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wink

    Okay,

    nogo with quoted-printable.

    I added the shockwave type to the header to see if it would work, it didnt, so Im taking it out.

    Yes its specified in the embed tag in the html.

    I found a very good article at http://www.arsdigita.com/asj/mime/ if anybody else wants to read up on it but it doesnt really address the problem I am having.

    For the first time in my life I have been waiting for some junk mime mail to show up with some flash in it

    Thanks alot for your help. If you happen to think of anything else let me know. In the meantime I have posted at a couple of other forums as well.

    If I get the solution I think I will post a tutorial on my site explicitly on sending newsletter style emails though most people would probably rather spend the $50 or so bucks to buy tsome ready made software

    cheers
    jp


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •