开发者

PHP Mailer -renaming the files?

开发者 https://www.devze.com 2023-02-18 21:12 出处:网络
I am following a video开发者_高级运维 tutorial in PHP (tutorial not available online for free) which is showing me how to use PHP Mailer. In the phpMailer I downloaded, the files are named, for exampl

I am following a video开发者_高级运维 tutorial in PHP (tutorial not available online for free) which is showing me how to use PHP Mailer. In the phpMailer I downloaded, the files are named, for example, smtp.php and phpMailer.php but when the author of the tutorial is referring to them in the file path he is putting a class. in front of the file name like this

includes/phpMailer/class.smtp.php");

am I supposed to change the names of the files from smtp.php to class.smtp.php, or do I leave the files named the way they are i.e. smtp.php, but refer to them in the file path class.smtp.php

Can someone please explain


You need to use the real filename - i.e. the filename in the include or require statement must match the name of the actual file..


if you change the name you may run into problems, if in the class it includes the file that you have changed, its ok to change but you will need to scan through all the files and append all the include()'s with the new name :)


Changing the names can run you in trouble. changing phpMailer.php to anyname won't affect much as it is the main file that you will be including for creating the phpmailer class so if you change the phpMailer.php to class.phpMailer.php or xyz.php just use include('samename') and rest are same.

but to rename smtp.php to class.smtp.php first open phpMailer.php and check line ~460. You may encounter something link:

function SmtpSend($header, $body) {
    include_once($this->PluginDir...

there you find the name for smtp.php. if its class.smtp.php rename your file to class.smtp.php or rename it to whatever it is written there...

0

精彩评论

暂无评论...
验证码 换一张
取 消