06-19-2010, 07:07 AM
[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
controller file
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')?>
<input type="text" value="subject" name="subject" /><br /> <br />
<textarea name="message" rows="15" cols="60" /></textarea><br /><br />
<input type="file" name="file_name" /><br /><br />
<input type="submit" value="Send quick mail" />
<?php echo form_close()?>
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";
}
}