简体   繁体   English

PHP Mailer-重命名文件?

[英]PHP Mailer -renaming the files?

I am following a video tutorial in PHP (tutorial not available online for free) which is showing me how to use PHP Mailer. 我正在观看一个PHP视频教程(该教程免费在线提供),该视频向我展示了如何使用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. 在我下载的phpMailer中,文件被命名为例如smtp.phpphpMailer.php但是当本教程的作者在文件路径中引用它们时,他正在放置一个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 ie smtp.php , but refer to them in the file path class.smtp.php 我应该将文件名从smtp.phpclass.smtp.php还是将文件命名为smtp.php ,但请在文件路径class.smtp.php

Can someone please explain 有人可以解释一下吗

您需要使用真实的文件名-即includerequire语句中的文件名必须与实际文件名匹配。

如果您更改名称,则可能会遇到问题,如果在类中包含您已更改的文件,可以更改,但是您将需要扫描所有文件,并将所有include()附加到新文件中。名称 :)

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. phpMailer.php更改为anyname不会造成太大影响,因为它是创建phpmailer类所要包含的主要文件,因此,如果将phpMailer.php更改为class.phpMailer.php或xyz.php,则只需使用include('相同)) ,其余部分相同。

but to rename smtp.php to class.smtp.php first open phpMailer.php and check line ~460 . 但要将smtp.php重命名为class.smtp.php,首先打开phpMailer.php并检查〜460 You may encounter something link: 您可能会遇到一些链接:

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

there you find the name for smtp.php . 在这里您可以找到smtp.php的名称。 if its class.smtp.php rename your file to class.smtp.php or rename it to whatever it is written there... 如果它的class.smtp.php将您的文件重命名为class.smtp.php或将其重命名为在那里写的任何文件...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM