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, 2022 in PHP by narikkadan
• 63,420 points
1,323 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,880 points
32,856 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,880 points
7,812 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,880 points
1,938 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,880 points
786 views
0 votes
1 answer
0 votes
0 answers

Get last executed query in MySQL with PHP/CodeIgniter

In my_model.php, I have: $query1 = ( ...something... ); $query2 ...READ MORE

Jul 22, 2022 in PHP by Kithuzzz
• 38,010 points
607 views
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
9,626 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
939 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP