Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7673645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:33:37+00:00 2026-05-31T16:33:37+00:00

Im trying to render emails on my site. The problem is that these emails

  • 0

Im trying to render emails on my site. The problem is that these emails contains html and css, which means that I suddenly can get a green background on the page. its not rendering the mail properly. Sometimes I see html tags and so on.( se picture in the link below)

http://nullpointer.se/pic.png

I hade my thoughts on iframe. But as you can see i dont have a link refere to in the iframe src parameter.

This is parts the code that im using (MVC)

This is the Model function that im using

function get_mail_num($email_number)
{
    $connection = imap_open($this->server, $this->user, $this->password);

    $mail['overview'] = imap_fetch_overview($connection,$email_number,0);
        $mail['message'] = imap_fetchbody($connection,$email_number,2);

        imap_close($connection);

        return $mail;
}

This is the controller function that are featching the mails and sending them to the view

function index() // the inbox
{
    $this->load->model('mail_model');
    $this->load->library('pagination');
    $this->load->library('table');  
    // config for table
    $config['total_rows'] = $this->mail_model->get_size();
    $config['per_page'] = 10;
    $config['full_tag_open'] = '<div id="pagination">';
    $config['full_tag_close'] = '</div>';
    $config['base_url'] = 'http://nullpointer.se/mailendar/mail/index';
    $config['num_links'] = 4;

    if(!$this->uri->segment(3)){$offset = 1;}else{$offset = $this->uri->segment(3);}
    $records = $this->mail_model->get_mail_header($config['per_page'],$offset);
    $data['output'] ="";
    $id = $offset;
    for($i = 0; $i < count($records);$i++)
    {
        if(empty($records[$i]->subject))
        {
            $records[$i]->subject = "No Subject";
        }
        $data['output'].= '<div onclick="funct('.$id.')" class="toggler '.($records[$i]->seen ? 'read' : 'unread').'">';
        $data['output'].= '<span  class="subject">'.$records[$i]->subject.'</span> ';
        $data['output'].= '<span  class="from">'.$records[$i]->from.'</span>';
        $data['output'].= '<span class="date">on '.$records[$i]->date.'</span>';
        $data['output'].= '</div>';

        $data['output'].= "<div class='body' id ='{$id}'> </div>";
        $id++;
    }
    $this->pagination->initialize($config);
    $data['page'] = "pages/mail";
    $this->load->view('includes/template',$data);   

}

This is the view that shows everything

    <div id="main" class="span-19 last colborder">
        <h2>Mail</h2>
            <?php echo $output//$this->table->generate(); ?>
            <?php echo $this->pagination->create_links(); ?>
    </div>
    <div id = "sidebar" class = "span-4 last">
            <h2>Options</h2>
            <a href = "Convert" class ="button">Convert</a>
            <a href = "Remove" class ="button">Remove</a>
            <a href = "Move" class ="button">Move</a>
    </div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:33:38+00:00Added an answer on May 31, 2026 at 4:33 pm

    You probably mentioned the easiest solution. You could simply create a simple email viewer, ex: viewer.php?id=123 for email id 123, then display the viewer through a simple iframe:

    <iframe width="[YOUR_WIDTH]" HEIGHT="[YOUR_HEIGHT]" src="viewer.php?id=123"></iframe>
    

    All you need to do in your viewer is to get the email body from your model, the echo it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to render a colored cube after rendering other cubes that have textures.
I'm trying to render to a texture, then draw that texture to the screen
I'm trying to render the sortable table that's provided in Google visualization API in
I'm trying to get plaxo's Address Book Access working. I'm having the following problem:
I'm trying to build a simple User Template system so that my users can
I am trying to create a basic template which displays the emails and corresponding
I'm trying to set up a simple Roles model for my site. Users can
Im trying to render a django template from a database outside of djangos normal
I am trying to render a user control into a string. The application is
I am trying to render a model in Direct3D using DrawIndexedPrimitives . However, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.