Hi,,
How to send mail using php..
Please help me to clear the following errors..Thanks in advance,
My code is:
$config = Array
(
'protocol' => 'smtp',
'smtp_host' => 'smtp.gmail.com',
'smtp_port' => 465,
'smtp_user' => '*******',
'smtp_pass' => '******',
'mailtype' => 'html',
'charset' => 'iso-8859-1',
'starttls' => true,
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('****','Ramkumar');
$this->email->to("*****");
$this->email->subject("Test mail");
$this->email->message("Test Mail using Php");
$this->email->send();
echo $this->email->print_debugger(); die;
My Errors after trying to run:
1) A PHP Error was encountered
Severity: Warning
Message: fsockopen(): unable to connect to localhost:25 (An attempt was made to access a socket in a way forbidden by its access permissions. )
Filename: libraries/Email.php
Line Number: 1689
2)
A PHP Error was encountered
Severity: Warning
Message: fwrite() expects parameter 1 to be resource, boolean given
Filename: libraries/Email.php
Line Number: 1846