Welcome Guest, Not a member yet? Register   Sign In
E-Mail is being printed to screen as well as being sent. Odd.
#1

[eluser]johnwbaxter[/eluser]
I've got a controller that sends an e-mail, then does some other stuff which loads a view that has a form in it which has some javascript that submits that form on page load. Don't ask me why, it just does!

Anyway, the e-mail gets sent fine, but when it loads the view it also prints the (html) e-mail to the page.

I really need to stop it doing this.

Here's some code.

Code:
$this->load->library('email');
            $this->load->library('parser');
            $this->email->from('[email protected]','Our Name');
            $this->email->to($email);
            $this->email->bcc('[email protected]');
            $this->email->subject('Our Name '. $insertorderdata->orderid);

            $emaildata = array(
                                          'ordername' => $insertorderdata->ordername,
                                          'order_number' => $insertorderdata->orderid,
                                          'order_date' => date ("d/m/Y", strtotime($insertorderdata->timestamp)),
                                          'order_status' => 'Pending',
                                          'company' => $emailrow->CompanyName,
                                          'first_name' => $emailrow->FirstName,
                                          'surname' => $emailrow->Surname,
                                          'job_title'=> $emailrow->JobTitle,
                                          'address_1' => $emailrow->AddressLine1,
                                          'address_2' => $emailrow->AddressLine2,
                                          'town' => $emailrow->Town,
                                          'county' => $emailrow->County,
                                          'postcode' => $emailrow->Postcode,
                                          'tel' => $emailrow->Telephone,
                                          'email' => $emailrow->username,
                                          'subtotal' => $insertorderdata->exc_vat,
                                          'vat' => $insertorderdata->vat,
                                          'total' => $insertorderdata->price,

              );
            $message = $this->parser->parse('email_templates/confirm_email.php',$emaildata);
            $this->email->message($message);
            $this->email->send();

Then it gets some data together and fires up a view:

Code:
$this->load->view('test', $data);

Then i do some of this madness in the view:

Code:
<html>
<body>
<?=$payment_form?>
<div>
Some Text is in here.
</div>


&lt;/body&gt;
&lt;/html&gt;

Sooooo if anyone can shed some light on this gosh darned crazyness i would really appreciate some assistance.


Messages In This Thread
E-Mail is being printed to screen as well as being sent. Odd. - by El Forum - 08-15-2008, 04:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB