PHP Deprecated Methods with the same name as their class will not be constructors in a future version of PHP

0 votes

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?

Jun 24 in PHP by narikkadan
• 10,840 points
52 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
0 answers
0 votes
1 answer

How to resolve the problem of losing a session after a redirect in PHP?

Hello @kartik, Carry out these usual checks: Make sure session_start(); is ...READ MORE

answered Aug 24, 2020 in PHP by Niroj
• 82,720 points
15,217 views
0 votes
1 answer

How do I get the HTML code of a web page in PHP?

Hello @kartik, If your PHP server allows url ...READ MORE

answered Oct 6, 2020 in PHP by Niroj
• 82,720 points
765 views
0 votes
1 answer

How do I get the last inserted ID of a MySQL table in PHP?

Hello @kartik, If you're using PDO, use PDO::lastInsertId. If you're ...READ MORE

answered Oct 22, 2020 in PHP by Niroj
• 82,720 points
471 views
0 votes
1 answer

How can I get the classname from a static call in an extended PHP class?

Hello @kartik, __CLASS__ always returns the name of the ...READ MORE

answered Oct 27, 2020 in PHP by Niroj
• 82,720 points
212 views
0 votes
1 answer
0 votes
2 answers

Define a SQL query? What is the difference between SELECT and UPDATE Query? How do you use SQL in SAS?

HI.. SQL is Structured Query Language, which is ...READ MORE

answered Aug 8, 2020 in PHP by anonymous
4,482 views
0 votes
1 answer

Why is not preferable to use mysql_* functions in PHP?

The reasons are as follows: The MySQL extension: Does ...READ MORE

answered Sep 7, 2018 in Database by DataKing99
• 8,240 points
338 views
0 votes
2 answers
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP