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

[eluser]Adam Griffiths[/eluser]
My model...

Code:
<?php

class Email_model extends Model
{
    function __construct()
    {
        parent::Model();
    }
    
    function index()
    {
        echo("You cannot access this page directly");
    }
    
    function quick($name, $email, $subject, $message)
    {
            $this->email->from($email, $name);
            $this->email->reply_to($email, $name);
            $this->email->to('[email protected]');

            $this->email->subject($subject);
            $this->email->message($message);

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

/* End of file email.php */
/* Location: system/application/models/ */

My controller...

Code:
<?php

class Email extends Controller
{
    function __construct()
    {
        parent::Controller();
        $this->load->helper('security');
        $this->load->helper('email');
    }
    
    function index()
    {
        echo("You cannot access this page directly");
    }
    
    function quick()
    {
        if($_POST['quickform'])
        {
            $name = xss_clean($_POST['name']);
            $email = xss_clean($_POST['email']);
            $subject = xss_clean($_POST['subject']);
            $message = xss_clean($_POST['message']);
            
            if($name | $email | $subject | $message == NULL)
            {
                $data['title'] = 'Quick Enquiry';
                $this->load->view('header', $data);
                $this->load->view('form/quick_posterror');
                $this->load->view('footer');
            }
            elseif(valid_email($email))
            {
                $this->load->model('email_model');
                
                $this->email_model->quick($name, $email, $subject, $message);

                $data['title'] = 'Quick Enquiry';
                $this->load->view('header', $data);
                $this->load->view('form/success');
                $this->load->view('footer');
            }
            else
            {
                $data['title'] = 'Quick Enquiry';
                $this->load->view('header', $data);
                $this->load->view('form/invalid_email');
                $this->load->view('footer');
            }
        }
        else
        {
            $data['title'] = 'Quick Enquiry';
            $this->load->view('header', $data);
            $this->load->view('form/quick_posterror');
            $this->load->view('footer');
        }
    }
}

/* End of file email.php */
/* Location: system/application/controllers/ */

The form in my view...

Code:
</div>

<div id="sidebar">
    
    <div class="box">
    <p class="head">Quick Enquiry Form</p>
    <p>&lt;?php echo form_open('email/quick');?&gt;</p>
    <p class="head2">Name:
    &lt;input type="text" name="name" class="quickform" /&gt;&lt;/p>
    <p class="head2">Email:
    &lt;input type="text" name="email" 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;

I get this from the debugger in the email class.

Quote:Your message has been successfully sent using the following protocol: mail

From: "Adam Griffiths"
Return-Path:
Reply-To: "Adam Griffiths"
X-Sender: EMAIL EDITED OUT IN CASE OF SPAM BOTS =]
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
test again
another test

So I know everything I put into the form is coming out the other end in the model etc. But the email doesn't get to my mailbox. Junk goes into my inbox anyway, so it isn't that the mail() function is blocked. I've tried it on two accounts. Can anybody see the problem? This is my first time using the email library so I'm a total newb with it.

Thanks in advance!


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