当前位置: 首页>>代码示例>>PHP>>正文


PHP email::Send方法代码示例

本文整理汇总了PHP中email::Send方法的典型用法代码示例。如果您正苦于以下问题:PHP email::Send方法的具体用法?PHP email::Send怎么用?PHP email::Send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在email的用法示例。


在下文中一共展示了email::Send方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: email

    exit;
}
// SET EMAIL ADDRESS TO SEND FORM RESULTS TO
$email_to = $ae_email;
//$email_to = 'stephen@stickyit.com';
if ($email_to == '') {
    $email_to = 'benjaminjohnjamieson@gmail.com';
}
// SET THE "FROM" FIELD
//$email_from = '$_POST['work_email']';
$email_from = 'mobiletech@mobiletechilm.com';
// SET EMAIL SUBJECT LINE
$email_subject = "General Contact Message From Website";
// CONSTRUCT EMAIL BODY
$email_body = "This is an automatic message" . "\n" . "Someone has submit a message through your contact page.\n" . "\n" . "* * * * * * * * * * * * * * * * * * * * * * * *\n" . "\n";
// CREATE EMAIL BASED ON POST VALUES, EXCEPT FOR THE SPECIFIED FIELDS
foreach ($_POST as $key => $value) {
    if ($key != 'country' && $key != 'time_stamp' && $key != 'max_file_size' && $key != 'submit_x' && $key != 'submit_y') {
        $email_label = $key;
        $email_label = str_replace('_', ' ', $email_label);
        $email_body .= $email_label . ": " . $_POST[$key] . "\n\n";
    }
}
$email_body .= "* * * * * * * * * * * * * * * * * * * * * * * *\n\n\n";
// SEND THE EMAIL TO FORM OWNER
$email = new email($email_from, $email_to, $email_subject, $email_body);
$email->Attach($_FILES[$fileField]);
$email->Send();
// REDIRECT USER TO SUCCESS PAGE
header("Location: ../form_results.php?result=success&type=bid");
exit;
开发者ID:benjaminjamieson,项目名称:auto-php-email-form,代码行数:31,代码来源:general_contact_form_code.php

示例2: sendMail

/**
 * Send mail
 *
 * @param string $subject
 * @param string $body
 * @param string $fromEmail
 * @param string $toEmail
 * @param string $ccEmail
 * @param string $bccEmail
 * @param string $attachement
 * @param string $bodyEncoding
 * @param integer $priority
 */
function sendMail($subject, $body, $fromEmail, $toEmail, $ccEmail = null, $bccEmail = null, $attachement = null, $bodyEncoding = 'utf-8', $priority = 1)
{
    $oMail = new email();
    $oMail->From($fromEmail);
    $oMail->To($toEmail);
    if ($ccEmail) {
        $oMail->Cc($ccEmail);
    }
    if ($bccEmail) {
        $oMail->Bcc($bccEmail);
    }
    $oMail->Subject($subject);
    $oMail->Body($body, $bodyEncoding, "text/html");
    $oMail->Priority($priority);
    if ($attachement) {
        $oMail->Attach($attachement, "application/x-unknown-content-type", "attachment");
    }
    $oMail->Send();
}
开发者ID:aliihaidar,项目名称:pso,代码行数:32,代码来源:functions.php


注:本文中的email::Send方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。