I'm working on small CodeIgniter application where I have to build my own contact us form, everything is working fine, receiving email but I need just add From Address
in the mail function?
CodeIgniter Mail Function
public function form() {
$this->load->library('form_validation');
$this->form_validation->set_rules('name', 'Name', 'trim|required|alpha');
$this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email');
$this->form_validation->set_rules('phone', 'Phone', 'trim|required|numeric');
$this->form_validation->set_rules('message', 'Message', 'trim|required');
$data['success'] = false;
if ($this->form_validation->run() == TRUE) {
@mail(config('webmaster_email'), 'Contact Us from ABC',""
. "Full Name: $_POST[name]\n"
. "Email: $_POST[email]\n"
. "Phone: $_POST[phone]\n"
. "Message: $_POST[message]\n"
. "");
$data['success'] = true;
}
$this->load->view($this->module, $data);
}
Need To Add This Line In The Form Mail Function
'From: webmaster@example.com'