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


PHP emailer::sendEmail方法代码示例

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


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

示例1: explode

<?php

//Include Libraries for SendGrid
include "../Libraries/email/SendGrid.php";
include "../Libraries/email/SendGrid/Email.php";
//Capture variables from Form Sender
$to = $_POST['to'];
$from = $_POST['from'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$cc = $_POST['cc'];
//Split email list into an array
$to = explode(";", $to);
//Send The emails to each individual in the list
for ($x = 0; $x < count($to); $x++) {
    emailer::sendEmail($to[$x], $from, $subject, $message, $cc);
}
//Echo a complete statement once its done
echo "complete";
//Emailer class
class emailer
{
    static function sendEmail($to, $from, $subject, $message, $cc)
    {
        //User credentials
        $sendgrid_username = "atushabe";
        $sendgrid_password = "atushabe123";
        //Set SendGrid Parameters
        $sendgrid = new SendGrid($sendgrid_username, $sendgrid_password, array("turn_off_ssl_verification" => true));
        //instantiate library class
        $email = new SendGrid\Email();
开发者ID:andrewolobo,项目名称:adMailer,代码行数:31,代码来源:emailer.php


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