PHPMailer: include(/var/www/sendingmail/protected/extensions/phpmailer/JPhpMailer.php) failed to open stream No such fil
Tag : php , By : terrestrial
Date : March 29 2020, 07:55 AM
I wish this help you I have figured it by myself, I have included this line in my controller -:- require("class.phpmailer.php");
|
PHPMailer- Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting?
Date : March 29 2020, 07:55 AM
it fixes the issue You must to have installed php_openssl.dll, if you use wampserver it's pretty easy, search and apply the extension for PHP. In the example change this: //Set the hostname of the mail server
$mail->Host = 'smtp.gmail.com';
//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission 465 ssl
$mail->Port = 465;
//Set the encryption system to use - ssl (deprecated) or tls
$mail->SMTPSecure = 'ssl';
|
i want to use phpmailer.for that i have installed composer,but still autoload file is missing
Date : March 29 2020, 07:55 AM
it should still fix some issue First Install Composer from this link. Then install it to your system. after installation open the command prompt and go to your project dir then use this command composer require phpmailer/phpmailer
|
Fatal error: Class 'PHPMailer\PHPMailer\Exception' not found in C:\wamp\www\Scaffolding\PHPMailer-master\src\PHPMailer.p
Date : March 29 2020, 07:55 AM
Any of those help You haven't imported the class into your namespace. If you don't do that, it will expect the class to have the namespace. It doesn't. <?php
namespace Random;
use Exception;
class Whatever
{
public function whatever()
{
throw new Exception();
}
}
<?php
namespace Random;
class Whatever
{
public function whatever()
{
throw new \Exception();
}
}
|
Fatal error: Constructor Autoload::autoload() cannot be static in C:\xampp\htdocs\project\autoload.php on line 3
Tag : php , By : James Lupiani
Date : March 29 2020, 07:55 AM
may help you . Your method name matches your class name -- this is PHP's old style of defining a constructor. Just change the name of either the class or the method so that they don't match. class Autoload
{
public static function load($className) {
$className = strtolower($className);
require_once $className.".php";
}
}
spl_autoload_register("Autoload::load");
|