How does php send mail about problems?

Source: Internet
Author: User
Tags php send mail rtrim
php Send mail problem??????
$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 ();
}
}

$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]

------Solution--------------------
You should encounter such a similar error:
Using $this when not in object context


------Solution--------------------
A whole bunch of questions.
function SendMail are functions outside the class, why are there $this words like this?
The Phpmailer () function is also undefined:
In short, LZ can first look at the relevant information of OOP
------Solution--------------------
Other aspects of the knowledge of their own bad to fill it.
PHP Object-Oriented programming
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);
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.