I have application where I want to send mails to clients but i am getting error from server.


Controller code for sending mail
$this->load->library('email');
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'mail.lmsweb.in';
$config['smtp_port'] = '25';
$config['smtp_user'] = '[email protected]';
$config['smtp_pass'] = '****';
// $config['charset'] = 'iso-8859-1';
$this->email->initialize($config);
$this->email->from('support@lmsweb', 'LMS');
$this->email->to($this->input->post('txtvisitoremail'));
$this->email->subject('Client Login Details');
$this->email->subject('Congratulation');
$this->email->send();
echo $this->email->print_debugger();
redirect('telecaller/telecaller/update');
Same code works when using on localhost but on server I get this error.
After changing protocol to mail I get:
Message: mail() [function.mail]: SMTP server response: 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server.
Filename: libraries/Email.php
Line Number: 1539
I then created a new test mail account, [email protected] and tried sending mail to it and it worked. So its clear that using mail protocol I cannot send mail to other like Gmail.
$config['newline'] = "\r\n";and$config['charset'] = 'UTF-8';help at all? - Daniel Waghorn