require PHPMailer is not working. Please help

the mail() function

Moderators: gesf, Michalio

Post Reply
aedwarddurai
New php-forum User
New php-forum User
Posts: 1
Joined: Tue May 03, 2022 5:39 am

Hi Team,
Good day. Need help for the below.

httpdocs folder, i just copied PHPMailer folder.

httpdocs-->PHPMailer

PHPMailer contains all php files like class.pop3.php, class.smtp.php, class.phpmailer.php and etc,


Just created one file httpdocs-->sendmail.php

sendmail.php file content is below. its not recognizing
require 'PHPMailer/PHPMailerAutoload.php';.

its printing only "before PHPMailerAutoload :". please help me - why its not printing "after phpmailer autoload". Thanks in advance.
<?php
echo "before PHPMailerAutoload :";
echo "<br>";
require 'PHPMailer/PHPMailerAutoload.php';
echo "after phpmailer autoload";
?>

Regards,
Edward
tekmunkey
php-forum Active User
php-forum Active User
Posts: 37
Joined: Wed Apr 27, 2022 11:24 am

PHP processes or executes line-by-line from top to bottom. So when the runtime encounters the first echo, that is piped straight to output. Then the require (or the code in the required file) generates an error, at which point PHP should be writing an entry to the error log explaining why it stopped processing. It is the "stopped processing at the error" part that makes the second echo not show up in your browser.

When you require, PHP begins processing/executing line by line into that file, as if the content of that file appeared where the require line occurs in the original file.

By default, PHP should be writing error logs to your webserver's (or website's) error.log file. You need to look in there to find out what the problem is.
Post Reply