dimanche 3 décembre 2017

PHPMailer not understanding how to import

I am trying to write a form using phpmailer to send job applications to HR.

I am using xampp.

I am not understanding the installation process of PHPMailer as I cannot see the files phpmailerautoload.php in the downloaded zip from Github.

Following is the php code that I written

 <?php
echo getcwd();
error_reporting(E_ALL); 
ini_set('display_errors', '1');
use \burgundy\mail\PHPMailer;
use \burgundy\mail\Exception;

require 'C:\xampp\htdocs\burgundy\mail\PHPMailer\PHPMailer\src\Exception.php';
require 'C:\xampp\htdocs\burgundy\mail\PHPMailer\PHPMailer\src\PHPMailer.php';
require 'C:\xampp\htdocs\burgundy\mail\PHPMailer\PHPMailer\src\SMTP.php';

try {
    if(isset($_POST['email_send'])) {
        $mail = new \burgundy\mail\PHPMailer\PHPMailer\PHPMailer();

I get the following error on the last line.

C:\xampp\htdocs\burgundy
Fatal error: Uncaught Error: Class 'burgundy\mail\PHPMailer\PHPMailer\PHPMailer' not found in C:\xampp\htdocs\burgundy\sendEmail.php:14 Stack trace: #0 {main} thrown in C:\xampp\htdocs\burgundy\sendEmail.php on line 14

Can someone please help as to where am I going wrong? If you need any more info please let me know and I will give it.




Aucun commentaire:

Enregistrer un commentaire