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


PHP Email::setMessage方法代码示例

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


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

示例1: setAnalysisEmail

 public function setAnalysisEmail(Analyse $analysis, $emailTo, $toName)
 {
     $content = new Content();
     $message = $content->getAnalysisContent($analysis, Session::getLoggedUser()->getFirstName());
     $email = new Email();
     $email->setSubject("Olá " . $toName . "! Você recebeu uma análise do Bureau Inteligencia!");
     $email->setMessage($message);
     return $email->send(null, $emailTo);
 }
开发者ID:raigons,项目名称:bureauinteligencia,代码行数:9,代码来源:EmailController.php

示例2: email

function email($to, $subject, $message, $headers = null, $params = null)
{
    // Basic validation for to address(es)
    if (!strpos($to, "@")) {
        return false;
    }
    // Create new instance of email class
    $email = new Email();
    // Generate recipient details
    $recipients = explode(",", $to);
    // Proccess multiple addresses
    for ($i = 0; $i < count($recipients); $i++) {
        // Check for name and email combination and add apropriately
        if (strpos($recipients[$i], '<')) {
            $recipient = explode("<", $recipients[$i], 2);
            $email->addRecipient(trim(str_replace('"', '', $recipient[0])), trim(str_replace('>', '', @$recipient[1])));
        } else {
            $email->addRecipient(trim($recipients[$i]));
        }
    }
    // Set subject
    $email->setSubject($subject);
    // Generate Headers
    $headers = explode("\r\n", $headers);
    for ($i = 0; $i < count($headers); $i++) {
        $email->addHeader($headers[$i]);
    }
    // Set message content
    $email->setMessage($message);
    // Check for specified sender
    if (strpos($params, "-f") !== false) {
        $sender = explode('-f', $params);
        $sender = explode(' ', @$sender[1]);
        $sender = trim($sender[0]);
        $email->setAnnounceEmail($sender);
    }
    // Send message
    return $email->send();
}
开发者ID:msabino,项目名称:beth-maria,代码行数:39,代码来源:email.php

示例3: Email

 function test_setMessage()
 {
     //Arrange
     $name = "Bill";
     $email = "bill@gmail.com";
     $subject = "Just saying hi";
     $message = "Hello to you good sir";
     $notarobot = "123";
     $test_email = new Email($name, $email, $subject, $message, $notarobot);
     //Act
     $new_message = "Hello to you good sir, again";
     $test_email->setMessage($new_message);
     $result = $test_email->getMessage();
     //Assert
     $this->assertEquals("Hello to you good sir, again", $result);
 }
开发者ID:bjkropff,项目名称:send_email,代码行数:16,代码来源:EmailTest.php

示例4: Form

require 'core.php';
$Form = new Form();
$Email = new Email();
if (!isset($_POST['submit'])) {
    redirect('forgot_password.php');
} else {
    if (!isset($_POST['email']) || empty($_POST['email'])) {
        $Form->setError('email', 'Please write your email address');
    }
    if ($Form->num_errors > 0) {
        $Form->return_msg_to('forgot_password.php');
    } else {
        $email = cleanData($_POST['email']);
        $user = mysql_fetch_assoc(mysql_query('SELECT * FROM ' . TBL_USER . ' WHERE email="' . $email . '"'));
        if (!$user) {
            $Form->setError('notFound', 'User Not Found.');
            $Form->return_msg_to('forgot_password.php');
        } else {
            $Email->setEmailSubject('Forgot Password');
            $Email->setMessage('Your password is ' . $user['password']);
            $Email->setEmailTo($email);
            if ($Email->sendMail()) {
                $Form->setError('success', 'Your password has been sent to your email. Please check your mails.');
                $Form->return_msg_to('forgot_password.php');
            } else {
                $Form->setError('notFound', 'User Not Found.');
                $Form->return_msg_to('forgot_password.php');
            }
        }
    }
}
开发者ID:Dwetech,项目名称:Windowfreak1985,代码行数:31,代码来源:action_forgot_password.php

示例5: cleanData

            $Form->setError('leadsError', 'Please select call time and enter a phone number');
        }
    }
    if ($Form->num_errors > 0) {
        $Form->return_msg_to('view.php');
    } else {
        $first_name = cleanData($_POST['first_name']);
        $last_name = cleanData($_POST['last_name']);
        $lead_result = cleanData($_POST['lead_result']);
        $call_time = cleanData($_POST['call_time']);
        $phone_no = cleanData($_POST['phone_no']);
        $notes = cleanData($_POST['notes']);
        $leadAdd = insertQuery(TBL_LEADS, array('user_id' => $_SESSION['user_id'], 'first_name' => $first_name, 'last_name' => $last_name, 'lead_result' => $lead_result, 'call_time' => $call_time, 'phone_no' => $phone_no, 'notes' => $notes, 'create_date' => 'NOW()'));
        if (!$leadAdd) {
            $Form->setError('error', 'Database error! Please try again.');
            $Form->return_msg_to('view.php');
        } else {
            if ($lead_result == 'Y') {
                $leadData = mysql_fetch_object(mysql_query("SELECT agency.agency_name, leads.first_name, leads.last_name, leads.phone_no, leads.call_time, leads.notes FROM leads LEFT JOIN user ON user.id = leads.user_id LEFT JOIN agency ON agency.id = user.agency_id WHERE leads.id = {$leadAdd}"));
                $Email->setEmailSubject('A new lead has been submitted.');
                $Email->setMessage("A new lead has been submitted for agency <b>{$leadData->agency_name}</b> by <b style='color: #9B0202' >{$_SESSION->first_name} {$_SESSION->last_name}</b> with following info:<br/><br/>" . "<b style='color: #9B0202'>Lead         :</b> <span style='color: #9B0202' > {$leadData->first_name} {$leadData->last_name} </span> <br/>" . "<b>Phone       :</b> {$leadData->phone_no} <br/>" . "<b>Time to Call:</b> {$leadData->call_time} <br/>" . "<b>Note         :</b> {$leadData->notes}. ");
                $sentMailQuery = mysql_query("SELECT email FROM user WHERE type='admin' AND receive_email ='Y'");
                while ($sentMail = mysql_fetch_assoc($sentMailQuery)) {
                    $Email->setEmailTo($sentMail['email']);
                    $Email->sendMail();
                }
            }
            redirect('view.php?leads=success');
        }
    }
}
开发者ID:Dwetech,项目名称:Windowfreak1985,代码行数:31,代码来源:action_new_leads.php

示例6: setLoanMilestone

 /**
  * @param LoanApplication $application
  * @param $milestoneId
  * @param $milestoneGroupId
  * @return mixed
  */
 public function setLoanMilestone(LoanApplication $application, $milestoneId, $milestoneGroupId)
 {
     try {
         $integrationSite = $this->losConnection->getSite();
         //print_r('Site ID: '. $integrationSite->getId() . ' | Milestone ID: '. $milestoneId . ' | Milestone Group ID: ' . $milestoneGroupId);
         $newMilestone = $this->em->getRepository('SudouxMortgageBundle:LoanMilestone')->findOneMilestoneByLosId($integrationSite, $milestoneId, $milestoneGroupId);
         //print_r('Milestone Name: ' . $newMilestone->getName());
         if (isset($newMilestone)) {
             // check for a change and send to the
             $currentMilestone = $application->getMilestone();
             if (isset($currentMilestone)) {
                 $sendNotifications = $application->getSite()->getSettings()->getInheritedSendMilestonesNotifications();
                 $user = $application->getUser();
                 if ($currentMilestone->getId() != $newMilestone->getId() && $sendNotifications && isset($user)) {
                     if ($user->hasRole('ROLE_MEMBER')) {
                         $email = new Email();
                         $email->setSubject("Your loan status has been updated");
                         $email->setMessage(sprintf("Your loan status for %s has been updated to %s.", $application->getPropertyLocation()->getAddress1(), $newMilestone->getName()));
                         $email->setRecipient($user->getEmail());
                         $email->setSite($application->getSite());
                         $application->addEmail($email);
                         $emailUtil = $this->container->get('sudoux.cms.message.email_util');
                         $emailUtil->logAndSend($email);
                     }
                 }
             }
             $application->setMilestone($newMilestone);
             $application->setMilestoneGroup($newMilestone->getMilestoneGroup());
         } else {
             $e = new \Exception("Milestone not found for loan " . $application->getId());
             $this->logger->crit($e->getMessage());
         }
     } catch (\Exception $e) {
         $this->logger->crit($e->getMessage());
     }
 }
开发者ID:eric19h,项目名称:turbulent-wookie,代码行数:42,代码来源:Destiny.php


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