[eluser]Apfel1988[/eluser]
Hello,
i will use the Email class to send emails via codeigniter.
But when i send the form i have the following errors:
Code:
A PHP Error was encountered
Severity: Notice
Message: Undefined index: From
Filename: libraries/Email.php
Line Number: 1254
A PHP Error was encountered
Severity: Notice
Message: Undefined index: From
Filename: libraries/Email.php
Line Number: 918
A PHP Error was encountered
Severity: Notice
Message: Undefined index: Return-Path
Filename: libraries/Email.php
Line Number: 569
A PHP Error was encountered
Severity: Notice
Message: Undefined index: Subject
Filename: libraries/Email.php
Line Number: 937
A PHP Error was encountered
Severity: Notice
Message: Undefined index: From
Filename: libraries/Email.php
Line Number: 1444
A PHP Error was encountered
Severity: Warning
Message: mail() expects parameter 1 to be string, array given
Filename: libraries/Email.php
Line Number: 1444
This is my php code:
Code:
$this->load->library('email');
$this->load->helper('email');
if(!$this->input->post('mail') || !valid_email($this->input->post('mail')))
$data['error'] = 1;
elseif(!$this->input->post('name')) $data['error'] = 2;
elseif(!$this->input->post('message')) $data['error'] = 3;
else{
$this->email->from($this->input->post('mail'), $this->input->post('name'));
$this->email->to('[email protected]');
$this->email->subject('HP Anfrage');
$this->email->message($this->input->post('message'));
$config['smtp_host'] = ...;
$config['smtp_user'] = '...';
$config['smtp_pass'] = '...';
$this->email->initialize($config);
$this->email->send();
$data['ready'] = true;
}
I have valdiate the parameters for all email functions and tested via echo,..
Is anybody here who can tell me the Problem?
Thank you very much.