Welcome Guest, Not a member yet? Register   Sign In
Mail sending problems.
#18

[eluser]johnwbaxter[/eluser]
Oh i did strip out some code.

Try this little lot:

View: (form/form.php):

Code:
<html>
<body>
</div>

<div id="sidebar">
    
    <div class="box">
    <p class="head">Quick Enquiry Form</p>
    <p>&lt;?php echo form_open('test/quick');?&gt;</p>
    <p class="head2">Name:
    &lt;input type="text" name="name" class="quickform" /&gt;&lt;/p>
    <p class="head2">Email2:
    &lt;input type="text" name="email2" class="quickform" /&gt;&lt;/p>
    <p class="head2">Subject:
    &lt;input type="text" name="subject" class="quickform" /&gt;&lt;/p>
    <p class="head2">Message:
    &lt;textarea class="quickformbig" rows="0" cols="0" name="message"&gt;&lt;/textarea></p>
    <p>&lt;input type="submit" name="quickform" class="send" /&gt;&lt;/p>
    &lt;/form&gt;
    </div>
    
    </div>
    
    <div id="footer">
    <div id="copyright">
    <div id="text1">&copy; Nanoswift MMVIII</div>
    </div>
    </div>
    
&lt;/body&gt;
&lt;/html&gt;

controller: (test.php)

Code:
&lt;?php

class Test extends Controller{

    function Test()
    {
        
        parent::Controller();
        
        
    }
    
        
    function quick()
    {
        
        $name = $_POST['name'];
        $email2 = $_POST['email2'];
        $subject = $_POST['subject'];
        $message = $_POST['message'];
        
        $this->load->model('emailmod');
                
        $this->emailmod->quick($name, $email2, $subject, $message);
        $data['title'] = 'Quick Enquiry';
        $this->load->view('header', $data);
        $this->load->view('form/success');
        $this->load->view('footer');
    }
    
}

?&gt;

model: (emailmod.php)
Code:
&lt;?php

class Emailmod extends Model
{
    function __construct()
    {
        parent::Model();
        $this->load->library('email');
    }
    
    function index()
    {
        echo("You cannot access this page directly");
    }
    
    function quick($name, $email2, $subject, $message)
    {
            echo("Name: ".$name."<br />");
            echo("Email: ".$email2."<br />");
            echo("Subject: ".$subject."<br />");
            echo("Message: ".$message."<br />");

            
            $this->email->from($email2, $name);
            $this->email->reply_to($email2, $name);
            $this->email->to('[email protected]');

            $this->email->subject($subject);
            $this->email->message($message);
            
            $this->email->send();
            
            echo $this->email->print_debugger();
    }
}

?&gt;

I stripped out a load of your code to minimise on problems and changed a few names of stuff just because i was changing things around.

Here is the controller that loads the form view if you want it:

Code:
&lt;?php

class Testy extends Controller{




function Testy(){

parent::Controller();


}

function index(){

$this->load->view('form/form');
}


}

?&gt;

let me know how you get on.


Messages In This Thread
Mail sending problems. - by El Forum - 07-28-2008, 10:21 AM
Mail sending problems. - by El Forum - 07-28-2008, 11:29 AM
Mail sending problems. - by El Forum - 07-28-2008, 11:40 AM
Mail sending problems. - by El Forum - 07-28-2008, 11:48 AM
Mail sending problems. - by El Forum - 07-28-2008, 12:44 PM
Mail sending problems. - by El Forum - 07-28-2008, 01:42 PM
Mail sending problems. - by El Forum - 07-28-2008, 02:10 PM
Mail sending problems. - by El Forum - 07-28-2008, 02:35 PM
Mail sending problems. - by El Forum - 07-28-2008, 02:43 PM
Mail sending problems. - by El Forum - 07-28-2008, 02:48 PM
Mail sending problems. - by El Forum - 07-28-2008, 02:53 PM
Mail sending problems. - by El Forum - 07-29-2008, 03:05 AM
Mail sending problems. - by El Forum - 07-29-2008, 03:13 AM
Mail sending problems. - by El Forum - 07-29-2008, 08:27 AM
Mail sending problems. - by El Forum - 07-29-2008, 08:36 AM
Mail sending problems. - by El Forum - 07-29-2008, 08:43 AM
Mail sending problems. - by El Forum - 07-29-2008, 08:50 AM
Mail sending problems. - by El Forum - 07-29-2008, 08:50 AM
Mail sending problems. - by El Forum - 07-29-2008, 08:52 AM
Mail sending problems. - by El Forum - 07-29-2008, 09:24 AM
Mail sending problems. - by El Forum - 07-29-2008, 09:26 AM
Mail sending problems. - by El Forum - 07-29-2008, 09:30 AM
Mail sending problems. - by El Forum - 05-11-2009, 08:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB