I am using PHPmailer for sending email in PHP. It is working fine on localhost but it gives me an error of absolute path in cloudways hosting server.
My directory structure.
-home
-
public_html
phpmailer
sendmail.php
My code for requiring phpmailer is.
require_once dirname(__FILE__).'/PHPMailer-master/src/phpmailer.php
I also tried another approach-
require_once '/home/xxxxxxx/public_html/phpmailer/PHPMailer-master/src/phpmailer.php
The exact error is-
Warning: require_once(/home/152903.cloudwaysapps.com/xxxxxxx/public_html/phpmailer/PHPMailer-master/src/phpMailer.php): failed to open stream: No such file or directory in /home/152903.cloudwaysapps.com/kjmwdjvxpz/public_html/check2.php on line 5
Fatal error: require_once(): Failed opening required '/home/152903.cloudwaysapps.com/kjmwdjvxpz/public_html/phpmailer/PHPMailer-master/src/phpMailer.php' (include_path='.:/usr/share/php') in /home/152903.cloudwaysapps.com/kjmwdjvxpz/public_html/check2.php on line 5
But it does not work. Can someone sort out this problem?