I'm created this email sending form, it worked until I change the code to this (this is my controller):
public function sendMail()
{
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'mymail@gmail.com',
'smtp_pass' => 'mypass',
'mailtype' => 'html',
'charset' => 'utf-8'
);
$this->load->library('email', $config);
$this->email->set_newline("
");
$this->email->from($this->input->post('email'));
$this->email->to('mymail@gmail.com');
$this->email->phone($this->input->post('phone'));
$this->email->contact($this->input->post('contact'));
$this->email->subject($this->input->post('subject'));
$this->email->message($this->input->post('message'));
if( $this->email->send() ){
redirect ('/');
} else
{
show_error($this->email->print_debugger());
}
}
and the HTML/PHP part:
<form method="post" action="<?php echo base_url('Email/sendMail'); ?>" accept-charset="utf-8" name="contactform" id="contactform">
<div class="col-md-6">
<fieldset>
<input name="first_name" type="text" id="name" size="30" placeholder="Név">
<br>
<input name="contact" type="text" id="contact" size="30" placeholder="Email">
<br>
<input name="phone" type="text" id="phone" size="30" placeholder="Telefon">
<br>
<input name="subject" type="text" id="subject" size="30" placeholder="Tárgy">
<br>
</fieldset>
</div>
<div class="col-md-6">
<fieldset>
<textarea name="message" cols="40" rows="20" id="message" placeholder="Üzenet, Kérdés, Kérés..."></textarea>
</fieldset>
</div>
<div class="col-md-12">
<fieldset>
<input type="submit" class="btn btn-lg" name="submit" id="submit" value="Üzenet Elküldése">
</div>
</form>
After Submit it gest a: Message: Call to undefined method CI_Email::contact() also in phone etc.
Thanks for the helps in advance!