#1 Read message in iFrame OPTION


I would like to give my users the option to display
the body of the message there reading in an iFrame. I
have personly have played with this in other web based
e-mail clients and have found that having the body
displayed in an iFrame realy helps in displaying HTML
formated messages.


  • Nobody/Anonymous

    Logged In: NO

    I have hacked Squirrelmail to display in an iframe, but
    there is no user options to turn it on or off.

    You will need to edit read_body.php

    Comment out echo $body; or just remove it.
    // echo $body;

    afer that line add this code. This code also adds a link
    to open the iframe page in a new window for a cleaner print
    out. Also if the broser dose not support iFrames it should
    still display the message.

    print "<center><iframe src=\"iframe.php\" width=\"709\"
    height=\"341\" scrolling=\"yes\" frameborder=\"0
    print "<br><a href='iframe.php' target='_new'>Printable

    Then you need to create new page. Call it iframe.php and
    put it under src.

    in this new file place this code.

    print "$body";

    its that easy.

  • Paul Thompson - OLD ACCOUNT

    • labels: --> 369933
  • Paul Thompson - OLD ACCOUNT

    • labels: 369933 --> 369955
    • milestone: --> 156779
  • Robin Rainton

    Robin Rainton - 2002-03-29

    Logged In: YES

    This seems like a good idea, as a lot of HTML mail isn't
    so nice and screws up the look of the right hand pane
    (although sometimes the SM stylesheet in use has an
    adverse affect on the message body.

    Anyhow, the annonymous message dated 2001-08-24 looks
    likes it must be from an older version of SM than I have
    as I don't see code sections like this.

    However, using version 1.2.5 I have had succeess getting
    inline frames to work by modifying read_body.php, and then
    mime.php. The change to mime.php was required as the
    formatBody function returns not only the main contents,
    but attachment links, etc. I made it return these in an
    array (body, with separate link HTML). When iframes are
    not in use then both parts can be concatenated, but when
    they are one, or the other will be discarded.

    I added a section to build a frame much like the older
    message (this is near the bottom of read_body.php), but
    made the content URL read_body.php with a body_only=1
    variable, then trap that variable just after the session
    starts with something like this in that code:

    if (isset($body_only) && $body_only) {
    $message = sqimap_get_message($imapConnection,
    $passed_id, $mailbox);

    // formatBody now returns two parts

    list ($body, $after_body) = formatBody($imapConnection,
    $message, $color, $wrap_at);
    echo $body;

    I made the iframe attributes:

    width=100% height=500 frameborder=0 scrolling=auto
    marginwidth=0 marginheight=0

    This all works very well, but could do with a little tidy
    up. For example, I don't see a way to make the frame to
    veritcally auto size to it's contents/parent frame, anyone
    know how to make this look nicer than a fixed height?).

    I think it might also be nice to make the 'View unsafe
    images' link javascript so it just did a reload of the
    iframe, and not the whole page.

    Any comments?

  • Tomas Kuliavas

    Tomas Kuliavas - 2005-05-06
    • assigned_to: nobody --> tokul
  • Tomas Kuliavas

    Tomas Kuliavas - 2006-09-30

    Logged In: YES

    Implemented in 1.5cvs. Moving to stable 1.4.x and setting
    lowest priority.

  • Tomas Kuliavas

    Tomas Kuliavas - 2006-09-30
    • labels: 369955 -->
    • milestone: 156779 -->
    • priority: 5 --> 1
    • status: open --> open-fixed
  • Tomas Kuliavas

    Tomas Kuliavas - 2006-10-01
    • assigned_to: tokul --> nobody

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks