Welcome Guest, Not a member yet? Register   Sign In
How can i send email via form in CI ?
#1

[eluser]dhaulagiri[/eluser]
I only get email title doing this, how can i get user input message in mail as well ?
pls help

view file
Code:
<?php echo form_open_multipart('quickmail/send_quickly')?>
&lt;input type="text" value="subject" name="subject" /&gt;&lt;br /> <br />
&lt;textarea name="message" rows="15" cols="60" /&gt;&lt;/textarea><br /><br />
&lt;input type="file" name="file_name" /&gt;&lt;br /><br />
&lt;input type="submit" value="Send quick mail" /&gt;
&lt;?php echo form_close()?&gt;

controller file
Code:
function send_quickly()
    {

        
        //get data
      $subject = $this->input->post('subject');
      $email = '[email protected]';
      $message = $this->input->post('message');
        
        
        $this->load->library('email');
        $this->email->set_newline("\r\n");

        $this->email->from('[email protected]', 'mycc');
        $this->email->to($email);
        $this->email->subject($subject);
        $this->email->message($message);
        
        $path = '';
        $file_name = $path;
        
        $this->email->attach($file_name);
        
        if($this->email->send()){
            $this->confirm_sent();
        }else{
            echo "Message not sent";
        }
    }


Messages In This Thread
How can i send email via form in CI ? - by El Forum - 06-19-2010, 07:07 AM
How can i send email via form in CI ? - by El Forum - 06-19-2010, 07:59 AM
How can i send email via form in CI ? - by El Forum - 06-19-2010, 04:12 PM
How can i send email via form in CI ? - by El Forum - 06-19-2010, 04:14 PM
How can i send email via form in CI ? - by El Forum - 06-19-2010, 04:15 PM
How can i send email via form in CI ? - by El Forum - 06-20-2010, 12:32 AM
How can i send email via form in CI ? - by El Forum - 06-20-2010, 01:46 AM
How can i send email via form in CI ? - by El Forum - 06-20-2010, 07:51 AM
How can i send email via form in CI ? - by El Forum - 06-20-2010, 09:25 AM
How can i send email via form in CI ? - by El Forum - 06-20-2010, 10:03 AM
How can i send email via form in CI ? - by El Forum - 06-20-2010, 03:13 PM
How can i send email via form in CI ? - by El Forum - 06-20-2010, 03:19 PM
How can i send email via form in CI ? - by El Forum - 06-20-2010, 04:03 PM
How can i send email via form in CI ? - by El Forum - 06-21-2010, 03:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB