ajaxmailsend.php

来自「有关ajax的开发方法以及源码,希望对大家有所帮组。」· PHP 代码 · 共 29 行

PHP
29
字号
<?php
    require_once("inc/config.inc.php");
    require_once("inc/phpmailer/class.phpmailer.php");
    require_once("inc/phpmailer/class.smtp.php");    
    require_once("inc/JSON.php");
    require_once("inc/AjaxMail.inc.php");
    
    //headers
    header("Content-Type: text/plain");
    header("Cache-control: No-Cache");
    header("Pragma: No-Cache");

    //get information
    $to = $_POST["txtTo"];
    $cc = $_POST["txtCC"];
    $subject = $_POST["txtSubject"];
    $message = $_POST["txtMessage"];

    //create new mailbox
    $mailbox = new AjaxMailbox();

    //create JSON object in case its needed
    $oJSON = new JSON();
    
    //send the mail
    $response = $mailbox->sendMail($to, $subject, $message, $cc);
    $output = $oJSON->encode($response);      
    echo $output;    
?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?