• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

php 发送邮件有关问题?

php 搞代码 4年前 (2022-01-23) 10次浏览 已收录 0个评论

php 发送邮件问题??????
<?php
$pathCommon = dirname(__FILE__).”\_common5″;
$pathCommon =str_replace(“\cpar1″,””,$pathCommon);
include($pathCommon.’\root.php’);

class test{
var $dbCon;
var $root;
var $pathCommon;

var $js;
var $func;

……本2文来源gaodai.ma#com搞##代!^码@网3

搞代gaodaima码 var $funcUsage;
var $css;
var $mail;

function test($pathCommon=””){
$this->pathCommon = $pathCommon;
$this->root = new root($this->pathCommon);
$this->root->DB();
$this->dbCon = new DB(‘BITINTRA’);
$this->dbCon->errorShow = true;
$this->js = $this->root->JavaScript();
$this->func = $this->root->Functional();
$this->funcUsage = $this->func->Usage();
$this->css = $this->root->CSS();
$this->view = $this->root->View();
$this->page = $this->view->page();
$this->box = $this->view->box();
$this->grp = $this->view->group();
$this->mail = $this->root->Mail();
}
}

$To = “[email protected]”;
$Cc = “[email protected]”;
sendMail(“ACTION”,”,rtrim($To,”,”),rtrim($Cc,”,”),$Text);

function sendMail($sendTo,$stepIndex=””,$to=””,$cc=””,$Text=””){
$this->mail->phpMailer();
$msg = ‘

Dear ALL

‘;
$msg.=$Text;
$subject = ” Test”;
$this->mail->sendMail($subject, $msg, “test”, $to, $cc, “”, “”, “AA”);
}
?>[code=PHP][/code]

——解决方案——————–
你应该遇到这样类似的错误:
Using $this when not in object context

——解决方案——————–
一大堆问题。
function sendMail是类之外的函数,为什么会有$this这样的字眼呢?
phpMailer()函数也未定义。。
总之,lz可以先看看 OOP的相关资料
——解决方案——————–
其它方面的知识自己恶补一下吧。
php面向对象编程

PHP code

 $pathCommon = dirname(__FILE__)."\_common5"; $pathCommon =str_replace("\cpar1","",$pathCommon); include($pathCommon.'\root.php');class test{  var $dbCon;  var $root;  var $pathCommon;    var $js;  var $func;  var $funcUsage;  var $css;  var $mail;  function test($pathCommon=""){        $this->pathCommon = $pathCommon;      $this->root = new root($this->pathCommon);      $this->root->DB();      $this->dbCon = new DB('BITINTRA');      $this->dbCon->errorShow = true;      $this->js = $this->root->JavaScript();        $this->func = $this->root->Functional();      $this->funcUsage = $this->func->Usage();      $this->css = $this->root->CSS();      $this->view = $this->root->View();      $this->page = $this->view->page();      $this->box = $this->view->box();      $this->grp = $this->view->group();      $this->mail = $this->root->Mail();  }    function sendMail($sendTo,$stepIndex="",$to="",$cc="",$Text=""){      $this->mail->phpMailer();      $msg = '

Dear ALL

'; $msg.=$Text; $subject = " Test"; $this->mail->sendMail($subject, $msg, "test", $to, $cc, "", "", "AA"); }} $test = new test(); $To = "[email protected]"; $Cc = "[email protected]"; $test->sendMail("ACTION",'',rtrim($To,","),rtrim($Cc,","),$Text);


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:php 发送邮件有关问题?

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址