I am working on creating an application in CodeIgniter When I send mail while registering. I'm getting an error:
PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; emailcomm has a deprecated constructor in /var/www/html/portal/application/libraries/emailcomm.php on line 3
The emailcomm.php
class emailcomm
{
var $to;
var $subject;
var $message;
var $from='From:';
function emailcomm()
{
$this->CI=&get_instance();
ini_set("SMTP","ssl://smtp.gmail.com");
ini_set("smtp_port","465");
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'smtp.gmail.com';
$config['smtp_port'] = '465';
$config['_smtp_auth']=TRUE;
$config['smtp_user'] = 'contact-us@webtech.com';
$config['smtp_pass'] = 'Web8*98*2015';
$config['smtp_timeout'] = '60';
$config['charset'] = 'utf-8';
$config['wordwrap'] = TRUE;
$config['mailtype'] = "html";
$this->CI->load->library('email',$config);
$this->CI->email->initialize($config);
}
}
My code is not working after upgrading my server to php7. How can I fix my code?