sendEmail() публичный Метод

Given a SimpleEmailServiceMessage object, submits the message to the service for sending.
public sendEmail ( SimpleEmailServiceMessage $sesMessage, boolean $use_raw_request = false, boolean $trigger_error = null ) : array
$sesMessage SimpleEmailServiceMessage An instance of the message class
$use_raw_request boolean If this is true or there are attachments to the email `SendRawEmail` call will be used
$trigger_error boolean Optionally overwrite the class setting for triggering an error (with type check to true/false)
Результат array An array containing the unique identifier for this message and a separate request id. Returns false if the provided message is missing any required fields. @link(AWS SES Response formats, http://docs.aws.amazon.com/ses/latest/DeveloperGuide/query-interface-responses.html)
Пример #1
0
 public function send(array $emails, $subject, $body)
 {
     $m = new \SimpleEmailServiceMessage();
     $m->setFrom($this->email);
     $m->addTo($emails);
     $m->setSubject($subject);
     $m->setMessageFromString('', $body);
     return $this->ses->sendEmail($m);
 }
Пример #2
0
 public static function sendSESFromHtml($html, $to, $subject)
 {
     $tos = array();
     if (!empty($to)) {
         $array = explode(";", $to);
         if (!empty($array) && sizeof($array) > 0) {
             foreach ($array as $mail) {
                 if (!empty($mail)) {
                     array_push($tos, $mail);
                 } else {
                     error_log($mail . " not valid");
                 }
             }
         }
     }
     if (!empty($tos) && sizeof($tos) > 0) {
         $ses = new SimpleEmailService(AWS_SES_API_KEY, AWS_SES_API_SECRET);
         $ses->enableVerifyPeer(false);
         $m = new SimpleEmailServiceMessage();
         $m->setSubjectCharset("UTF-8");
         $m->setMessageCharset("UTF-8");
         foreach ($tos as $mail) {
             $m->addTo($mail);
         }
         $m->setFrom(AWS_SES_API_FROM);
         $m->setSubject($subject);
         $m->setMessageFromString(null, $html);
         return $ses->sendEmail($m);
     } else {
         error_log(LanguageUtils::getText("LANG_UTILS_MAIL_ERROR_EMAIL_EMPTY"));
     }
     return false;
 }
Пример #3
0
 protected function renderContent()
 {
     if (isset($this->block) && $this->block != null) {
         $model = new UserRegisterForm();
         // if it is ajax validation request
         if (isset($_POST['ajax']) && $_POST['ajax'] === 'userregister-form') {
             echo CActiveForm::validate($model);
             Yii::app()->end();
         }
         // collect user input data
         if (isset($_POST['UserRegisterForm'])) {
             $model->attributes = $_POST['UserRegisterForm'];
             // validate user input password
             if ($model->validate()) {
                 $new_user = new User();
                 $new_user->scenario = 'create';
                 //$new_user->username=$model->username;
                 $new_user->username = $new_user->email = $model->email;
                 $new_user->display_name = $model->username;
                 $old_password = $new_user->password = $model->password;
                 //Create hash activation key
                 $new_user->user_activation_key = md5(time() . $new_user->username . USER_SALT);
                 if ($new_user->save()) {
                     //We will send mail for the user
                     $ses = new SimpleEmailService(ConstantDefine::AMAZON_SES_ACCESS_KEY, ConstantDefine::AMAZON_SES_SECRET_KEY);
                     $ses->enableVerifyHost(false);
                     $m = new SimpleEmailServiceMessage();
                     $m->addTo($new_user->email);
                     $m->setFrom(ConstantDefine::AMAZON_SES_EMAIL);
                     $m->setSubject('[' . SITE_NAME . '] Confirm your email at ' . SITE_NAME_URL);
                     $m_content = 'Hi ' . $new_user->display_name . '<br /><br />';
                     $m_content .= 'Welcome to ' . SITE_NAME . '! Please take a second to confirm ' . $new_user->email . ' as your email address by clicking this link: <br /><br />';
                     $link_content = FRONT_SITE_URL . '/user-activation/?key=' . $new_user->user_activation_key . '&user_id=' . $new_user->user_id;
                     $m_content .= '<a href="' . $link_content . '">' . $link_content . '</a><br /><br />';
                     $m_content .= 'Thank you for being with us!<br /><br />';
                     $m_content .= SITE_NAME . ' Team';
                     $m->setMessageFromString($m_content, $m_content);
                     $ses->sendEmail($m);
                     //Redirect to the Dashboard Page
                     $login_form = new UserLoginForm();
                     $login_form->username = $new_user->username;
                     $login_form->password = $old_password;
                     if ($login_form->login()) {
                         Yii::app()->controller->redirect(bu());
                     } else {
                         throw new CHttpException(503, t('Error while setting up your Account. Please try again later'));
                     }
                 }
             }
         }
         $this->render(BlockRenderWidget::setRenderOutput($this), array('model' => $model));
     } else {
         echo '';
     }
 }
Пример #4
0
 public function mail($to, $title, $message, $fullName = "")
 {
     $panelInit = new \DashboardInit();
     $settings = $panelInit->settingsArray;
     $this->title = $settings['siteTitle'];
     $this->settings = json_decode($settings['mailProvider'], true);
     if ($this->settings['mailProvider'] == "" || !isset($this->settings['mailProvider'])) {
         exit;
     }
     if ($this->settings['mailProvider'] == "mail") {
         $header = "From: " . $settings['systemEmail'] . "\r\n";
         $header .= "MIME-Version: 1.0\r\n";
         $header .= "Content-Type: text/html; charset=utf-8\r\n";
         $header .= "X-Priority: 1\r\n";
         mail($to, $title, $message, $header);
     } elseif ($this->settings['mailProvider'] == "phpmailer") {
         $mail = new PHPMailer();
         $mail->From = $settings['systemEmail'];
         $mail->FromName = $settings['siteTitle'];
         $mail->addAddress($to, $fullName);
         $mail->Subject = $title;
         $mail->Body = $message;
         $mail->IsHTML(true);
         $mail->send();
     } elseif ($this->settings['mailProvider'] == "smtp") {
         $mail = new PHPMailer();
         $mail->IsSMTP();
         $mail->SMTPAuth = true;
         $mail->Host = $this->settings['smtpHost'];
         $mail->Port = $this->settings['smtpPort'];
         $mail->Username = $this->settings['smtpUserName'];
         $mail->Password = $this->settings['smtpPassWord'];
         if (isset($this->settings['smtpTLS']) && $this->settings['smtpTLS'] != "") {
             if ($this->settings['smtpTLS'] == "TLS") {
                 $mail->SMTPSecure = 'tls';
             } elseif ($this->settings['smtpTLS'] == "SSL") {
                 $mail->SMTPSecure = 'ssl';
             }
         }
         $mail->SetFrom($settings['systemEmail'], $settings['siteTitle']);
         $mail->Subject = $title;
         $mail->Body = $message;
         $mail->addAddress($to, $fullName);
         $mail->IsHTML(true);
         $mail->Send();
     } elseif ($this->settings['mailProvider'] == "ses") {
         $amazonSES = new SimpleEmailService($this->settings['AmazonSESAccessKey'], $this->settings['AmazonSESSecretKey']);
         $m = new SimpleEmailServiceMessage();
         $m->addTo($to);
         $m->setFrom($this->settings['AmazonSESVerifiedSender']);
         $m->setSubject($title);
         $m->setMessageFromString(strip_tags($message), $message);
         return $amazonSES->sendEmail($m);
     }
 }
Пример #5
0
 protected function renderContent()
 {
     if (isset($this->block) && $this->block != null) {
         $model = new UserRecoverPassForm();
         // if it is ajax validation request
         if (isset($_POST['ajax']) && $_POST['ajax'] === 'recoverpassword-form') {
             echo CActiveForm::validate($model);
             Yii::app()->end();
         }
         // collect user input data
         if (isset($_POST['UserRecoverPassForm'])) {
             $model->attributes = $_POST['UserRecoverPassForm'];
             // validate user input and redirect to the previous page if valid
             if ($model->validate()) {
                 //Find the user with the email
                 $user = User::model()->find('email=:email', array(':email' => $model->email));
                 if ($user) {
                     //Create a new password recover key
                     $key = md5(USER_RECOVER_PASS_SALT . time() . $user->username . $user->email);
                     $user->email_recover_key = $key;
                     if ($user->save()) {
                         $ses = new SimpleEmailService(ConstantDefine::AMAZON_SES_ACCESS_KEY, ConstantDefine::AMAZON_SES_SECRET_KEY);
                         $ses->enableVerifyHost(false);
                         $m = new SimpleEmailServiceMessage();
                         $m->addTo($user->email);
                         $m->setFrom(ConstantDefine::AMAZON_SES_EMAIL);
                         $m->setSubject('[' . SITE_NAME . '] Password reset instructions');
                         $m_content = 'Hi ' . $user->display_name . '<br /><br />';
                         $m_content .= 'A request to reset your ' . SITE_NAME . ' password has been made. If you did not make this request, simply ignore this email. If you did make this request, just click the link below:<br /><br />';
                         $link_content = FRONT_SITE_URL . '/reset-password/?key=' . $user->email_recover_key . '&user_id=' . $user->user_id;
                         $m_content .= '<a href="' . $link_content . '">' . $link_content . '</a><br /><br />';
                         $m_content .= 'If the URL above does not work, try copying and pasting it into your browser.<br /><br />';
                         $m_content .= 'If you continue to have problems, please feel free to contact us: <a href="mailto:' . ConstantDefine::SUPPORT_EMAIL . '">' . ConstantDefine::SUPPORT_EMAIL . '</a><br /><br />';
                         $m_content .= 'Thank you for being with us!<br /><br />';
                         $m_content .= SITE_NAME . ' Team';
                         $m->setMessageFromString($m_content, $m_content);
                         $ses->sendEmail($m);
                         user()->setFlash('success', 'Instructions to reset your password have been sent to you. Please check your email.');
                         Yii::app()->controller->redirect(bu() . '/sign-in');
                     }
                 } else {
                     user()->setFlash('error', 'Email is not existed');
                 }
             }
         }
         $this->render(BlockRenderWidget::setRenderOutput($this), array('model' => $model));
     } else {
         echo '';
     }
 }
Пример #6
0
 public function sendEmail()
 {
     $email = str_replace('INTRODUCEE_NAME', $this->introducee->getName(), str_replace('OTHER_NAME', $this->other->getName(), str_replace('INTRODUCER_NAME', $this->userName, str_replace('LINK', $this->introductionUrl . '', Content::getInstance()->getEmail('email-introduction')))));
     $subject = str_replace('INTRODUCEE_NAME', $this->introducee->getName(), str_replace('INTRODUCER_NAME', $this->userName, Content::c()->introduce->email));
     // Send the email with AWS SES
     $ses = new SimpleEmailService(SES_KEY, SES_SECRET);
     $ses->enableVerifyHost(false);
     $ses->enableVerifyPeer(false);
     $m = new SimpleEmailServiceMessage();
     $m->addTo($this->introducee->getEmail());
     $m->setFrom(SES_FROM);
     $m->setSubject($subject);
     $m->setMessageFromString($subject . ' ' . $this->introductionUrl, $email);
     $result = $ses->sendEmail($m);
     if (!$result) {
         return false;
     }
     // Save the email result to the database
     $sth = $this->db->prepare('INSERT INTO aws_ses (recipient_id, ses_message_id, ses_request_id, introduction_id) VALUES (:recipient_id, :ses_message_id, :ses_request_id, :introduction_id)');
     $sth->execute(array(':recipient_id' => $this->introducee->getId(), ':ses_message_id' => $result['MessageId'], ':ses_request_id' => $result['RequestId'], ':introduction_id' => $this->introductionId));
     return true;
 }
Пример #7
0
\t\t
<span style='font-weight:bold;'>{$customer_s}</span></pre>
EOF;
        $ses = new SimpleEmailService('AKIAIU65Y4DAUM55JPMQ', '65cJ2xXwGO40w/Qs6nOyZV7j9d855019HhGuzn34');
        $message = new SimpleEmailServiceMessage();
        //$message->addTo('*****@*****.**'); 			       		 //收件人
        $message->addTo($buyermail);
        //收件人
        $message->setFrom($gmail);
        //发件人
        //print_r($ses->listVerifiedEmailAddresses());
        $message->setSubject('Message from Aliexpress Store: ' . $seller);
        // 邮件标题
        $message->setMessageFromString(NULL, $text);
        //内容
        //设置标题和内容编码
        $message->setSubjectCharset('UTF-8');
        $message->setMessageCharset('UTF-8');
        try {
            if ($ses->sendEmail($message)) {
                echo '发送成功' . "\n";
                $aliMark_obj->insertOKMail($seller, mysql_escape_string($buyer), $gmail, mysql_escape_string($buyermail), time(), mysql_escape_string($text));
            } else {
                echo '发送失败1' . "\n";
            }
            unset($aliMark_obj);
        } catch (Exception $e) {
            echo '发送失败2' . "\n";
        }
    }
}
    public function paymentProcess()
    {
        if ($_SERVER['REQUEST_METHOD'] == "POST") {
            $id = $_POST['custom'];
            list($aid, $cid) = explode('-', $id);
            $affinfo = $this->ClientModel->getAffiliatePaymentInfo($aid);
            // Check Number 1 ------------------------------------------------------------------------------------------------------------
            $receiver_email = $_POST['receiver_email'];
            if ($receiver_email == $affinfo->affiliate_paypal_account) {
                $payment_amount = $_POST['mc_gross'];
                if ($payment_amount == $affinfo->affiliate_client_reg_charge) {
                    // Check number 2 ------------------------------------------------------------------------------------------------------------
                    if ($_POST['payment_status'] == "Completed") {
                        // Handle how you think you should if a payment is not complete yet, a few scenarios can cause a transaction to be incomplete
                        // incs('config/dbcon.php');
                        // assign posted variables to local variables
                        $pstatus = $_POST['payment_status'];
                        $pamount = $_POST['mc_gross'];
                        $txn_id = $_POST['txn_id'];
                        $payer_email = $_POST['payer_email'];
                        $id = $_POST['custom'];
                        list($aid, $cid) = explode('-', $id);
                        $paytitle = $_POST['item_name1'];
                        $updatepayment = $this->ClientModel->paypalPaymentInsert($aid, $cid, $paytitle, $pamount, $payer_email, $txn_id, $pstatus);
                        // if ($updatepayment!='') {
                        $subject = 'Client Registration Payment';
                        // header part of email template
                        $msg = '<html>
										<head>
										<meta charset="utf-8">
										<title>Email Template</title>
										
										</head>
										
										<body>
										<div class="box" style="padding:0px;width:40%; margin:0 auto;-webkit-border-radius: 5px;
										-moz-border-radius: 5px;
										border-radius: 5px; border:1px solid #ccc;">
										<div class="title" style="-webkit-border-top-left-radius: 5px;
										-webkit-border-top-right-radius: 5px;
										-moz-border-radius-topleft: 5px;
										-moz-border-radius-topright: 5px;
										border-top-left-radius: 5px;
										border-top-right-radius: 5px; background:#ccc; color:#fff;">
										<h3 style="padding:10px; margin:0px; color:#ac6f00;"><img src="' . base_url() . 'frontend/images/logo.png" height="35px" style="vertical-align:middle;margin-right:15px;">The Credit University</h3>
										</div>
										<div class="content" style="padding:10px; font-size:14px;"><p style="font-size:13px;">';
                        $msg .= 'Payment Successfully completed. Please login <a href="' . base_url() . 'admin"> Click Here</a>';
                        // footer part of email template
                        $msg .= '</p></div>
									<div class="footer" style="-webkit-border-bottom-right-radius: 5px;
									-webkit-border-bottom-left-radius: 5px;
									-moz-border-radius-bottomright: 5px;
									-moz-border-radius-bottomleft: 5px;
									border-bottom-right-radius: 5px;
									border-bottom-left-radius: 5px;background:#ccc; color:#ac6f00; margin:0px; padding:1px 10px;">
									
									</div>
									</div>
									</body>
									</html>';
                        $this->load->library('SimpleEmailService');
                        $ses = new SimpleEmailService('AKIAISEC5PBG2F54VL4A', 'ZhRYSpKdUMLRrxPwy878UN+pJmnllAocdcYRpJwZ');
                        $ses->enableVerifyPeer(false);
                        //print_r($ses->verifyEmailAddress('*****@*****.**'));
                        $m = new SimpleEmailServiceMessage();
                        $m->addTo('contact <' . $updatepayment->email . '>');
                        $m->setFrom('The Credit University' . '<' . EMAILSENDER . '>');
                        $m->setSubject($subject);
                        $message = $msg;
                        $m->setMessageFromString('', $message);
                        $ses->sendEmail($m);
                        // }
                    }
                    //payment_status check
                }
            }
        } else {
            $subject = 'Fail CPN referrer Partner Registration Payment';
            $msg = '<html>
										<head>
										<meta charset="utf-8">
										<title>Email Template</title>
										
										</head>
										
										<body>
										<div class="box" style="padding:0px;width:40%; margin:0 auto;-webkit-border-radius: 5px;
										-moz-border-radius: 5px;
										border-radius: 5px; border:1px solid #ccc;">
										<div class="title" style="-webkit-border-top-left-radius: 5px;
										-webkit-border-top-right-radius: 5px;
										-moz-border-radius-topleft: 5px;
										-moz-border-radius-topright: 5px;
										border-top-left-radius: 5px;
										border-top-right-radius: 5px; background:#ccc; color:#fff;">
										<h3 style="padding:10px; margin:0px; color:#ac6f00;"><img src="' . base_url() . 'frontend/images/logo.png" height="35px" style="vertical-align:middle;margin-right:15px;">The Credit University</h3>
										</div>
										<div class="content" style="padding:10px; font-size:14px;"><p style="font-size:13px;">';
            $msg .= 'Payment Failed.';
            // footer part of email template
            $msg .= '</p></div>
									<div class="footer" style="-webkit-border-bottom-right-radius: 5px;
									-webkit-border-bottom-left-radius: 5px;
									-moz-border-radius-bottomright: 5px;
									-moz-border-radius-bottomleft: 5px;
									border-bottom-right-radius: 5px;
									border-bottom-left-radius: 5px;background:#ccc; color:#ac6f00; margin:0px; padding:1px 10px;">
									
									</div>
									</div>
									</body>
									</html>';
            $this->load->library('SimpleEmailService');
            $ses = new SimpleEmailService('AKIAISEC5PBG2F54VL4A', 'ZhRYSpKdUMLRrxPwy878UN+pJmnllAocdcYRpJwZ');
            $ses->enableVerifyPeer(false);
            //print_r($ses->verifyEmailAddress('*****@*****.**'));
            $m = new SimpleEmailServiceMessage();
            $m->addTo('contact <*****@*****.**>');
            $m->setFrom('The Credit University' . '<' . EMAILSENDER . '>');
            $m->setSubject($subject);
            $message = $msg;
            $m->setMessageFromString('', $message);
            $ses->sendEmail($m);
        }
    }
Пример #9
0
 function sendEmails($email, $link)
 {
     $emailMessage = "You've received email from " . $this->session->userdata(NAME) . ". Click " . $link . " to view the message.";
     $receiverUserInfo = $this->UserModel->getUserByEmail($email);
     $receiverName = $receiverUserInfo->first_name . ' ' . $receiverUserInfo->middle_initial . ' ' . $receiverUserInfo->last_name;
     $user_id = $this->session->userdata(USER_ID);
     $user_details = $this->UserModel->getUser($user_id);
     $email_sender = $user_details->first_name . ' ' . $user_details->middle_initial . ' ' . $user_details->last_name;
     $msg = $emailMessage;
     $subject = $this->input->post('subject');
     $this->load->library('SimpleEmailService');
     $ses = new SimpleEmailService('AKIAISEC5PBG2F54VL4A', 'ZhRYSpKdUMLRrxPwy878UN+pJmnllAocdcYRpJwZ');
     $ses->enableVerifyPeer(false);
     $m = new SimpleEmailServiceMessage();
     $m->addTo($email);
     $m->setFrom($email_sender . '<' . EMAILSENDER . '>');
     $m->setSubject($subject);
     $data = array('receiver' => $receiverName, 'emailer' => $email_sender, 'message' => $msg);
     $code = $this->parser->parse('administrator/mailed_template', $data);
     $m->setMessageFromString('', $code);
     $ses->sendEmail($m);
     $this->session->set_flashdata("su_message", "Email Sent Successfully...");
     redirect(ADMIN_PATH . "mail/compose");
 }
Пример #10
0
 public function quickConnect()
 {
     $this->load->library('form_validation');
     $this->load->model('UserModel');
     $this->load->model('EmailModel');
     $name = $this->input->post('name');
     $email = $this->input->post('email');
     $subject = 'Quick Connect';
     $adminUsers = $this->UserModel->getAdminUsers();
     foreach ($adminUsers as $userAdmin) {
         $receiverAdminId[] = $userAdmin->id;
         $receiverAdminEmail[] = $userAdmin->email;
     }
     $emailId = $this->EmailModel->insertEmails('Success', $receiverAdminId);
     $link = '<a href="' . base_url(ADMIN_PATH . "mail/read_mail/" . $emailId) . '" target="_blank">here</a>';
     $emailMessage = "You've received email from " . $name . ". Click " . $link . " to view the message.";
     $this->load->library('SimpleEmailService');
     $ses = new SimpleEmailService('AKIAISEC5PBG2F54VL4A', 'ZhRYSpKdUMLRrxPwy878UN+pJmnllAocdcYRpJwZ');
     $ses->enableVerifyPeer(false);
     $m = new SimpleEmailServiceMessage();
     $m->addTo('*****@*****.**');
     $m->setFrom($email . '<' . EMAILSENDER . '>');
     $m->setSubject($subject);
     $message = $emailMessage;
     $m->setMessageFromString('', $message);
     if ($ses->sendEmail($m)) {
         if ($this->uri->segment(1) == 'Contact' || $this->uri->segment(1) == 'contact') {
             $this->session->set_flashdata("su_message", "Email Sent Successfully");
             redirect("home");
         } else {
             echo "<script>alert('Email Sent Successfully');window.history.back();</script>";
         }
     }
 }
Пример #11
0
 function sendEmailsToClient($email, $line_detail)
 {
     $site_link = '<a href="' . base_url('member') . '" target="_blank">here</a>';
     $emailMessage = "You hav been added to your card by owner for verify. " . $line_detail . ' ' . ' Click' . ' .' . $site_link . " to login ";
     $msg = $emailMessage;
     $subject = "Added to the Card For Verify";
     $this->load->library('SimpleEmailService');
     $ses = new SimpleEmailService('AKIAISEC5PBG2F54VL4A', 'ZhRYSpKdUMLRrxPwy878UN+pJmnllAocdcYRpJwZ');
     $ses->enableVerifyPeer(false);
     $m = new SimpleEmailServiceMessage();
     $m->addTo($email);
     $m->setFrom($email_sender . '<' . EMAILSENDER . '>');
     $m->setSubject($subject);
     $message = $msg;
     $m->setMessageFromString('', $message);
     $ses->sendEmail($m);
     $this->session->set_flashdata("su_message", "Email Sent Successfully...");
 }
Пример #12
0
 /**
  * TrackEmailStatModel::sendTrackEmail()
  * 发送跟踪邮件
  * @param array $data 邮件内容
  * @return bool
  */
 public static function sendTrackEmail($data)
 {
     require_once WEB_PATH . 'lib/ses/SimpleEmailService.php';
     require_once WEB_PATH . 'lib/ses/SimpleEmailServiceRequest.php';
     require_once WEB_PATH . 'lib/ses/SimpleEmailServiceMessage.php';
     $smtpUser = $data['smtpUser'];
     $smtpPwd = $data['smtpPwd'];
     $smtpHost = $data['smtpHost'];
     $title = $data['title'];
     $content = $data['content'];
     $toUserEmail = $data['toUserEmail'];
     $toUserId = $data['toUserId'];
     $userEmail = $data['userEmail'];
     $userName = $data['userName'];
     $trackNum = $data['trackNumber'];
     $retryCount = $data['retryCount'];
     // print_r($data);
     // exit;
     //初始化邮件发送
     $ses = new SimpleEmailService($smtpUser, $smtpPwd);
     $m = new SimpleEmailServiceMessage();
     $m->addTo(array("{$toUserId} <{$toUserEmail}>"));
     //收件人
     $m->setFrom("{$userName} <{$userEmail}>");
     //发件人
     $m->setSubject($title);
     // 邮件标题
     $m->setMessageFromString(NULL, $content);
     //内容
     //设置标题和内容编码
     $m->setSubjectCharset('UTF-8');
     $m->setMessageCharset('UTF-8');
     $res = $ses->sendEmail($m);
     //发送邮件
     if (!empty($res['MessageId'])) {
         $flag = TransOpenApiModel::updateTrackNumber($trackNum, array("toEmailSend" => 1));
         if ($flag) {
             $res['sendFlag'] = 1;
         } else {
             $res['sendFlag'] = 2;
         }
     } else {
         $where = "trackNumber = '{$trackNum}' AND retryCount>='{$retryCount}' AND is_success = 0";
         $result = self::checkRetryCount($where);
         $counts = isset($result['retryCount']) ? intval($result['retryCount']) : 0;
         if ($counts >= $retryCount) {
             $flag = TransOpenApiModel::updateTrackNumber($trackNum, array("toEmailSend" => 2));
         }
         $res['sendFlag'] = 0;
     }
     return $res;
 }
Пример #13
0
 $campaign_html_body = stripslashes($confirmpageDet['email_html']);
 if ($form_format == 'ft') {
     $body = $campaign_text_body;
 } else {
     $body = $campaign_html_body;
     $text_body = $campaign_text_body;
 }
 $confirmlink = $configDetails['siteUrl'] . "confirmform.php?form_submit_id=" . base64_encode($form_submit_id);
 $body1 = str_replace("%%CONFIRMLINK%%", $confirmlink, $body);
 $text_body1 = str_replace("%%CONFIRMLINK%%", $confirmlink, $text_body);
 $mail->setMessageFromString($text_body1, $body1);
 $mail->addTo($subscription_EmailId);
 $mail->addReplyTo("*****@*****.**");
 $mail->setReturnPath("*****@*****.**");
 $sendArray = "";
 $sendArray = $ses->sendEmail($mail);
 if ($sendArray['errorcode'] == '400') {
     $confirmpageDet1 = $dbClass->getTableRecordSingle("form_page", "form_id=? and page_type=?", array($formId, 'erropage'));
     if ($confirmpageDet1['url'] != '') {
         $url = $confirmpageDet1['url'];
         $url = "http://" . $url;
         pageRedirection($url);
         //header('Location:$url');
         //exit;
     } else {
         echo stripslashes($confirmpageDet1['confirm_html']);
     }
 }
 $mail->ClearTo();
 $updateFrmSubmit['last_action'] = 'sendConfirm';
 $updateCondition = "form_submit_id=?";
 /**
  * Sends an Email to the Committer with the details
  *
  * @param Array $problems Problems
  *
  * @return void
  */
 public function sendEmail($problems)
 {
     $committer = $this->getCommitterDetails();
     $subject = "Coding Standards information about your Commit #" . $this->getCommitId();
     $message = 'Hey ' . $committer['name'] . ",\n\n";
     $message .= "We've found the following coding standards ";
     $message .= "notifications in your recent commit:\n\n";
     foreach ($problems as $problem) {
         $message .= 'File: ' . $problem['file'] . "\n";
         $message .= 'Type: ' . $problem['type'] . "\n\n";
         foreach ($problem['description'] as $line) {
             $message .= $line . "\n";
         }
         $message .= "\n";
     }
     $message .= "Sincerely,\n\nThe Coding Standards Validator Robot";
     $ses = new SimpleEmailService(SES_ACCESS, SES_SECRET);
     $mail = new SimpleEmailServiceMessage();
     $mail->addTo($committer['email']);
     $mail->setFrom(SES_EMAIL);
     $mail->setSubject($subject);
     $mail->setMessageFromString($message);
     $ses->sendEmail($mail);
 }
Пример #15
0
 function resetPassword()
 {
     $code = $this->autoGenerateCode();
     $email_to = $this->input->post('email');
     $answer_1 = $this->input->post('answer1');
     $answer_2 = $this->input->post('answer2');
     $result = $this->UserModel->checkQuestionsAnswers($email_to, $answer_1, $answer_2);
     $id = $this->UserModel->checkEmailId($email_to);
     if (!empty($id) && !empty($result)) {
         $this->UserModel->updateProfile(null, $id, $code);
         $subject = "Forgot Password";
         $message = "Click on the following link to reset your password";
         $this->load->library('SimpleEmailService');
         $ses = new SimpleEmailService('AKIAISEC5PBG2F54VL4A', 'ZhRYSpKdUMLRrxPwy878UN+pJmnllAocdcYRpJwZ');
         $ses->enableVerifyPeer(false);
         $m = new SimpleEmailServiceMessage();
         $from = '*****@*****.**';
         $m->addTo($email_to);
         $m->setFrom($from . '<' . EMAILSENDER . '>');
         $m->setSubject($subject);
         $msg = $message;
         $msg .= '<br/><a href="' . base_url() . 'member/changePassword' . '/' . $code . '">CLICK HERE</a>';
         $m->setMessageFromString('', $msg);
         $ses->sendEmail($m);
         $this->session->set_flashdata('message', "<b style=\"color:green; alignment:center;\" >Please refer to your email. The reset link has been send to your email successfully.</b>");
         redirect(base_url() . 'member/forgotpassword');
     } else {
         $this->session->set_flashdata('message', "<b style=\"color:red;\">Contact Broker For Difficulties</b>");
         redirect(base_url() . 'member/forgotpassword');
     }
 }
Пример #16
0
 public function sendEmails($emails, $subject, $templateId, $userId, $full_name = '', $other = '')
 {
     $this->load->library('SimpleEmailService');
     $ses = new SimpleEmailService('AKIAISEC5PBG2F54VL4A', 'ZhRYSpKdUMLRrxPwy878UN+pJmnllAocdcYRpJwZ');
     $ses->enableVerifyPeer(false);
     $simpleEmailServiceMessage = new SimpleEmailServiceMessage();
     if (!empty($emails)) {
         $simpleEmailServiceMessage->addTo($emails);
     } else {
         $simpleEmailServiceMessage->addTo($other);
     }
     $simpleEmailServiceMessage->setFrom('The Credit University' . '<' . EMAILSENDER . '>');
     $simpleEmailServiceMessage->setSubject($subject);
     if (empty($other)) {
         $code = $this->getInterpretedNewsLetterTemplate($templateId, $full_name, $userId, $this->NewsLetterModel->getCampaignId($templateId), $other = '');
     } else {
         $code = $this->getInterpretedNewsLetterTemplate($templateId, $full_name = '', $userId, $this->NewsLetterModel->getCampaignId($templateId), $other);
     }
     $simpleEmailServiceMessage->setMessageFromString('', $code);
     $sent = $ses->sendEmail($simpleEmailServiceMessage);
     return $sent;
 }
Пример #17
0
    function sendEmails()
    {
        $user_id = $this->session->userdata(USER_ID);
        $user_role_details = $this->RoleModel->getRolesByUserId($user_id);
        $email_sender_type = $user_role_details->value;
        $user_details = $this->UserModel->getUser($user_id);
        $email_sender = $user_details->first_name . ' ' . $user_details->middle_initial . ' ' . $user_details->last_name;
        $subject = $this->input->post('subject');
        $to_emails = $this->input->post('toemails[]');
        $msg = $this->input->post('msg');
        $name = $this->UserModel->getNameFromEmail($to_emails);
        $role_name = $this->UserModel->getRoleFromEmail($to_emails);
        $user_ids = $this->UserModel->getUserIdFromEmail($to_emails);
        $this->load->library('SimpleEmailService');
        $ses = new SimpleEmailService('AKIAISEC5PBG2F54VL4A', 'ZhRYSpKdUMLRrxPwy878UN+pJmnllAocdcYRpJwZ');
        $ses->enableVerifyPeer(false);
        $m = new SimpleEmailServiceMessage();
        $m->addTo($to_emails);
        $m->setFrom($email_sender . '<' . EMAILSENDER . '>');
        $m->setSubject($subject);
        $msg = '<html>
									<head>
									<meta charset="utf-8">
									<title>Email Template</title>
									</head>
								<body>
									<div class="box" style="padding:0px;width:40%; margin:0 auto;-webkit-border-radius: 5px;
									-moz-border-radius: 5px;
									border-radius: 5px; border:1px solid #ccc;">
									<div class="title" style="-webkit-border-top-left-radius: 5px;
								-webkit-border-top-right-radius: 5px;
								-moz-border-radius-topleft: 5px;
								-moz-border-radius-topright: 5px;
						border-top-left-radius: 5px;
								border-top-right-radius: 5px; background:#ccc; color:#fff;">
								<h3 style="padding:10px; margin:0px; color:#ac6f00;"><img src="' . base_url() . 'frontend/images/logo.png" height="35px" style="vertical-align:middle;margin-right:15px;">The Credit University</h3>
								</div>
								<div class="content" style="padding:10px; font-size:14px;"><p style="font-size:13px;">';
        $msg .= 'Dear User,<br/>';
        $msg .= $this->input->post('msg');
        $msg .= '<br/><br/>';
        $msg .= 'Yours Sincerely,<br/>';
        $msg .= $email_sender;
        $msg .= 'Americancpn <br/>';
        // footer part of email template
        $msg .= '</p></div>
								<div class="footer" style="-webkit-border-bottom-right-radius: 5px;
								-webkit-border-bottom-left-radius: 5px;
							-moz-border-radius-bottomright: 5px;
							-moz-border-radius-bottomleft: 5px;
							border-bottom-right-radius: 5px;
							border-bottom-left-radius: 5px;background:#ccc; color:#ac6f00; margin:0px; padding:1px 10px;">
							<p>Yours Sincerely,<br>
							The Credit University Team</p>
							</div>
							</div>
							</body>
						</html>';
        $message = $msg;
        $m->setMessageFromString('', $message);
        if ($ses->sendEmail($m)) {
            $this->EmailModel->insertEmails('Success', $email_sender, $email_sender_type, $name, $role_name, $user_ids);
            redirect(ADMIN_PATH . "user/mailbox");
        } else {
            redirect(ADMIN_PATH . "user/compose");
        }
    }
Пример #18
0
    /**
     * Execute the console command.
     *
     * @return void
     */
    public function fire()
    {
        include_once "/opt/nginx/html/laravel/vendor/SmartImage.class.php";
        try {
            $hash = $this->option('hash');
            $media = Media::where('hash', '=', $hash)->first();
            if ($media->files()->count() == 0) {
                echo "files";
                $url = 'http://s01.okaydrive.com/rt/plugins/httprpc/action.php';
                $myvars = 'mode=info&hash=' . $hash;
                $ch = curl_init($url);
                $username = '******';
                $password = '******';
                curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
                curl_setopt($ch, CURLOPT_POST, 1);
                curl_setopt($ch, CURLOPT_POSTFIELDS, $myvars);
                curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
                curl_setopt($ch, CURLOPT_HEADER, 0);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                $response = curl_exec($ch);
                $torrent_info = json_decode($response, true);
                $url = 'http://s01.okaydrive.com/rt/plugins/httprpc/action.php';
                $myvars = 'mode=fls&hash=' . $hash;
                $ch = curl_init($url);
                $username = '******';
                $password = '******';
                curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
                curl_setopt($ch, CURLOPT_POST, 1);
                curl_setopt($ch, CURLOPT_POSTFIELDS, $myvars);
                curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
                curl_setopt($ch, CURLOPT_HEADER, 0);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                $response = curl_exec($ch);
                $torrent_files = json_decode($response, true);
                $files = $torrent_files;
                if (!empty($files)) {
                    echo "not empty";
                    echo count($files);
                    $ignore_first_folder = true;
                    $id = 1;
                    $paths = array();
                    foreach ($files as $file) {
                        if ($torrent_info[3] != 0) {
                            $fd = parse_url(basename(str_replace("#", "", $torrent_info[2])) . '/' . str_replace("#", "", $file[0]));
                        } else {
                            $fd = parse_url(str_replace("#", "", $file[0]));
                        }
                        $path_parts = pathinfo($fd['path']);
                        $dirs = explode("/", $path_parts['dirname']);
                        for ($i = 0; $i <= count($dirs); $i++) {
                            if (isset($dirs[$i]) && $dirs[$i] != '.') {
                                $full_path = $this->fullpath($dirs, $i);
                                if (array_key_exists($full_path, $paths)) {
                                } else {
                                    $paths[$full_path]["id"] = $id;
                                    $paths[$full_path]["name"] = $dirs[$i];
                                    $prev_path = $this->fullpath($dirs, $i - 1);
                                    if (!isset($paths[$prev_path]["id"])) {
                                        $pv_p = 0;
                                    } else {
                                        $pv_p = $paths[$prev_path]["id"];
                                    }
                                    $new_folder = new MediaFlag();
                                    $new_folder->name = $dirs[$i];
                                    $new_folder->folder_id = $id;
                                    $new_folder->in = $pv_p;
                                    $new_folder->media_id = $media->id;
                                    $new_folder->save();
                                    $id++;
                                }
                            } elseif (isset($dirs[$i]) && $dirs[$i] == '.') {
                                //echo $path_parts["basename"].' 0';
                                $new_file = new MediaLike();
                                if ($torrent_info[3] != 0) {
                                    $new_file->path = basename(str_replace("#", "", $torrent_info[2])) . '/' . str_replace("#", "", $file[0]);
                                } else {
                                    $new_file->path = str_replace("#", "", $file[0]);
                                }
                                $new_file->name = $path_parts["basename"];
                                $new_file->type = $this->getExt($new_file->path);
                                $new_file->in = 0;
                                $new_file->size = $file[3];
                                $new_file->media_id = $media->id;
                                //$like->user_id = Auth::user()->id;
                                $new_file->save();
                                $ignore_first_folder = false;
                            } else {
                                if (isset($dirs[$i - 1]) && $dirs[$i - 1] != '.') {
                                    $full_path = $this->fullpath($dirs, $i - 1);
                                    //echo $path_parts["basename"].' '.$paths[$full_path]["id"];
                                    $new_file = new MediaLike();
                                    if ($torrent_info[3] != 0) {
                                        $new_file->path = basename(str_replace("#", "", $torrent_info[2])) . '/' . str_replace("#", "", $file[0]);
                                    } else {
                                        $new_file->path = str_replace("#", "", $file[0]);
                                    }
                                    $new_file->type = $this->getExt($new_file->path);
                                    $new_file->name = $path_parts["basename"];
                                    $new_file->in = $paths[$full_path]["id"];
                                    $new_file->size = $file[3];
                                    $new_file->media_id = $media->id;
                                    //$like->user_id = Auth::user()->id;
                                    $new_file->save();
                                }
                            }
                        }
                    }
                    $media["ignore_first"] = $ignore_first_folder;
                    $media->save();
                }
            }
            $files_local = $media->getFiles();
            if (!empty($files_local)) {
                echo "pro";
                $media_id = $media->id;
                shell_exec('nohup php /opt/nginx/html/artisan check:files --media=' . $media_id . ' > /dev/null 2>&1 & echo $!');
                $max_file_id = null;
                $max_file_size = 0;
                foreach ($files_local as $file) {
                    if ($file->type == "vid" || $file->type == "vid-conv") {
                        if ($file->size > $max_file_size) {
                            $max_file_size = $file->size;
                            $max_file_id = $file->id;
                        }
                    }
                }
                $media->max_file_id = $max_file_id;
                $media->save();
                $fast = false;
                foreach ($files_local as $file) {
                    if ($file->type == "vid" || $file->type == "vid-conv") {
                        if ($file->type == "vid") {
                            $fast = $this->getFast($file->path);
                        }
                        if ($file->id == $max_file_id) {
                            $info = $this->makeThumbs($media->id, $file->id, $media->id . '/' . $file->path, $fast, 13);
                        } else {
                            $info = $this->makeThumbs($media->id, $file->id, $media->id . '/' . $file->path, $fast, 1);
                        }
                        if (!empty($info) && $info != null) {
                            $info_decode_all = json_decode($info, true);
                            $info_decode = $info_decode_all["data"];
                            $new_fileinfo = new FileInfo();
                            $new_fileinfo->file_id = $file->id;
                            $new_fileinfo->media_id = $media->id;
                            $new_fileinfo->video_duration = $info_decode["video_duration"];
                            $new_fileinfo->video_codec_name = $info_decode["video_codec_name"];
                            $new_fileinfo->video_width = $info_decode["video_width"];
                            $new_fileinfo->video_height = $info_decode["video_height"];
                            $new_fileinfo->video_height = $info_decode["video_height"];
                            $new_fileinfo->video_ratio = $info_decode["video_ratio"];
                            $new_fileinfo->video_fps = $info_decode["video_fps"];
                            $new_fileinfo->audio_codec_name = $info_decode["audio_codec_name"];
                            $new_fileinfo->audio_bit_rate = $info_decode["audio_bit_rate"];
                            $new_fileinfo->save();
                        }
                    } elseif ($file->type == "img") {
                        //$this->setimages($file->name ,$media->id . '/'. $file->path);
                        $file_path_thumb = '/opt/nginx/html/public/cache/thumbs/' . $file->id . '.jpg';
                        $full_path = '/home/mfs/Downloads/transmission/completed/' . $media->id . '/' . $file->path;
                        if (file_exists($file_path_thumb)) {
                            unlink($file_path_thumb);
                        }
                        try {
                            $img = new SmartImage($full_path);
                            $img->resize(130, 130, true);
                            $img->saveImage($file_path_thumb, 85);
                        } catch (Exception $e) {
                            $full_path = '/home/mfs/Downloads/transmission/image.png';
                            $img = new SmartImage($full_path);
                            $img->saveImage($file_path_thumb, 85);
                        }
                        //file_put_contents($file_path_thumb, $file_img_tmp);
                    }
                }
                sleep(10);
                $save_base_thumbs = "/opt/nginx/html/public/snaps/thumbs/";
                $save_base_big = "/opt/nginx/html/public/snaps/big/";
                foreach ($files_local as $file) {
                    if ($file->type == "vid" || $file->type == "vid-conv") {
                        $snap_big_path = $save_base_big . $media->id;
                        if (!file_exists($snap_big_path)) {
                            mkdir($snap_big_path, 0775, true);
                        }
                        $snap_big_path_full = $snap_big_path . '/' . $file->id;
                        if (!file_exists($snap_big_path_full)) {
                            mkdir($snap_big_path_full, 0775, true);
                        }
                        $snap_thumb_path = $save_base_thumbs . $media->id;
                        if (!file_exists($snap_thumb_path)) {
                            mkdir($snap_thumb_path, 0775, true);
                        }
                        $snap_thumb_path_full = $snap_thumb_path . '/' . $file->id;
                        if (!file_exists($snap_thumb_path_full)) {
                            mkdir($snap_thumb_path_full, 0775, true);
                        }
                        if ($media->max_file_id != $file->id) {
                            $file_get = '/opt/nginx/html/laravel/public/snaps/' . $media->id . '/' . $file->id . '/1.jpg';
                            $snap_big_path_full_file = $snap_big_path_full . '/1.jpg';
                            $snap_thumb_path_full_file = $snap_thumb_path_full . '/1.jpg';
                            if (file_exists($snap_big_path_full_file)) {
                            } else {
                                try {
                                    $file_img = file_get_contents($file_get);
                                    file_put_contents($snap_big_path_full_file, $file_img);
                                    $img = new SmartImage($snap_big_path_full_file);
                                    $img->resize(130, 130, true);
                                    $img->saveImage($snap_thumb_path_full_file, 85);
                                } catch (Exception $e) {
                                    $img = new SmartImage('/opt/nginx/html/app/commands/1.png');
                                    $img->resize(130, 130, true);
                                    $img->saveImage($snap_thumb_path_full_file, 85);
                                }
                            }
                        } elseif ($media->max_file_id == $file->id) {
                            $frames = 13;
                            for ($k = 1; $k < $frames; $k++) {
                                $snap_big_path_full_file = $snap_big_path_full . '/' . $k . '.jpg';
                                $snap_thumb_path_full_file = $snap_thumb_path_full . '/' . $k . '.jpg';
                                $file_get = '/opt/nginx/html/laravel/public/snaps/' . $media->id . '/' . $file->id . '/' . $k . '.jpg';
                                if (file_exists($snap_big_path_full_file)) {
                                } else {
                                    try {
                                        $file_img = file_get_contents($file_get);
                                        file_put_contents($snap_big_path_full_file, $file_img);
                                        $img = new SmartImage($snap_big_path_full_file);
                                        $img->resize(130, 130, true);
                                        $img->saveImage($snap_thumb_path_full_file, 85);
                                    } catch (Exception $e) {
                                        $img = new SmartImage('/opt/nginx/html/app/commands/1.png');
                                        $img->resize(130, 130, true);
                                        $img->saveImage($snap_thumb_path_full_file, 85);
                                    }
                                }
                            }
                        }
                    }
                }
                while (MediaLike::where('media_id', '=', $media->id)->where('cksum', '=', '')->count() != 0) {
                    sleep(1);
                }
                $media["state"] = 'done';
                $media->save();
                $media_users = $media->usersMedia();
                foreach ($media_users as $media_user) {
                    try {
                        $user_this = User::where('id', '=', $media_user->user_id)->first();
                        if (isset($user_this->email) && $user_this->ea) {
                            require_once '/opt/nginx/html/vendor/php-aws-ses-master/src/ses.php';
                            $ses = new SimpleEmailService('AKIAJNUKDR6WQV2PJLEA', 'Q0p4SCDdHK5QddvUICYj/xMfoAbcxa7buuRYTJyY');
                            $m = new SimpleEmailServiceMessage();
                            $m->addTo($user_this->email);
                            $m->setFrom('DATAS Support <*****@*****.**>');
                            $m->setSubject('Your files are ready to download.');
                            $html = '<table class="yiv7962433916container" align="center" cellspacing="0" border="0" cellpadding="0" width="580" bgcolor="#FFFFFF" style="width:580px;background-color:#FFF;border-top:1px solid #DDD;border-bottom:1px solid #DDD;" id="yui_3_13_0_1_1397466773730_2821">
												<tbody id="yui_3_13_0_1_1397466773730_2820"><tr id="yui_3_13_0_1_1397466773730_2819">
													<td class="yiv7962433916title" style="padding-top:34px;padding-left:39px;padding-right:39px;text-align:left;border-left-width:1px;border-left-style:solid;border-left-color:#DDD;border-right-width:1px;border-right-style:solid;border-right-color:#DDD;" id="yui_3_13_0_1_1397466773730_2818">
														<h2 style="font-family:Helvetica Neue, Arial, Helvetica, sans-serif;font-size:30px;color:#262626;font-weight:normal;margin-top:0;margin-bottom:13px;margin-right:0;margin-left:0;padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;letter-spacing:0;" id="yui_3_13_0_1_1397466773730_2817">Your file is ready!</h2>
														<h3 style="font-family:Helvetica Neue, Arial, Helvetica, sans-serif;font-size:16px;color:#3e434a;font-weight:normal;margin-top:0;margin-bottom:19px;margin-right:0;margin-left:0;padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;line-height:25px;" id="yui_3_13_0_1_1397466773730_2824">The file <b>' . $media->title . '</b> has been downloaded and ready to Play, Download, Convert or Stream.</h3>
													</td>
												</tr>
												<tr id="yui_3_13_0_1_1397466773730_2831">
													<td class="yiv7962433916cta" align="left" style="background-color:#F1FAFE;font-size:14px;color:#1f1f1f;border-top-width:1px;border-top-style:solid;border-top-color:#DAE3EA;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#DAE3EA;border-left-width:1px;border-left-style:solid;border-left-color:#DDD;border-right-width:1px;border-right-style:solid;border-right-color:#DDD;margin-top:0;margin-bottom:0;margin-right:0;margin-left:0;padding-top:20px;padding-bottom:20px;padding-right:39px;padding-left:39px;text-align:left;" id="yui_3_13_0_1_1397466773730_2830">
														<table cellspacing="0" border="0" cellpadding="0" width="500" align="left">
															<tbody><tr>
																<td width="24"></td>
																<td class="yiv7962433916link" align="left" style="font-family:Helvetica Neue, Arial, Helvetica, sans-serif;padding-left:9px;font-size:14px;"><strong><a rel="nofollow" style="color:#2b6cb5;font-family:Arial;font-size:12px;" target="_blank" href="https://okaydrive.com/torrent/' . $media_user->uni_id . '">Click here to go to your file</a></strong></td>
															</tr>
														</tbody></table>
													</td>
												</tr>
												<tr id="yui_3_13_0_1_1397466773730_2827">
													<td class="yiv7962433916footer" style="color:#797c80;font-size:12px;border-left-width:1px;border-left-style:solid;border-left-color:#DDD;border-right-width:1px;border-right-style:solid;border-right-color:#DDD;padding-top:23px;padding-left:39px;padding-right:13px;padding-bottom:23px;text-align:left;" id="yui_3_13_0_1_1397466773730_2826">
														<p style="font-family:Helvetica Neue, Arial, Helvetica, sans-serif;margin-top:0;margin-bottom:0;margin-right:0;margin-left:0;padding-top:0;padding-bottom:13px;padding-right:0;padding-left:0;line-height:20px;" id="yui_3_13_0_1_1397466773730_2832">
															You can login with <a rel="nofollow" style="font-weight:bold;text-decoration:none;color:inherit;cursor:default;">' . $user_this->username . '</a> at <a rel="nofollow" target="_blank" href="https://okaydrive.com" id="yui_3_13_0_1_1397466773730_2833">https://okaydrive.com</a>
														</p>
														<p style="font-family:Helvetica Neue, Arial, Helvetica, sans-serif;margin-top:0;margin-bottom:0;margin-right:0;margin-left:0;padding-top:0;padding-bottom:13px;padding-right:0;padding-left:0;line-height:20px;" id="yui_3_13_0_1_1397466773730_2825">Want some help with using our site? Simply reply to this email or email us - support@okaydrive.com. Email alerts are enabled by default, you may disable email alerts in your account settings.</p>
													</td>
												</tr>
												<tr>
											</tr></tbody></table>';
                            $m->setMessageFromString('', $html);
                            $ses->sendEmail($m);
                        }
                    } catch (Exception $e) {
                    }
                }
            }
        } catch (Exception $e) {
            file_put_contents('/home/mfs/l.log', $e);
        }
    }
Пример #19
0
require_once 'SimpleEmailServiceRequest.php';
require_once 'SimpleEmailServiceMessage.php';
//$ses = new SimpleEmailService('AKIAJPVRUB4LGXGH3TIA', 'KnbZBhbold1tmaKXJTQWkojbN/U0Ui90LmzNb/VW');
$ses = new SimpleEmailService('AKIAIA6Y4B5I5AGUJL4A', 'PZbv8lalsoKGZUsmdBcBp9ugAlM+/hV/3uZoj1+s');
// print_r($ses->verifyEmailAddress('*****@*****.**'));
//print_r($ses->listVerifiedEmailAddresses());
$m = new SimpleEmailServiceMessage();
$m->addTo('*****@*****.**');
//收件人
// $m->addCC(array('*****@*****.**','*****@*****.**')); //抄送 收件人
// $m->addBCC('*****@*****.**'); //密送 收件人
$m->setFrom('*****@*****.**');
//发件人
$m->setSubject('Hello, world!');
// 邮件标题
$m->setMessageFromString(NULL, '<b>This is the message body.<b><br/><font color="red">gyj</font>');
//内容
//设置标题和内容编码
$m->setSubjectCharset('UTF-8');
$m->setMessageCharset('UTF-8');
print_r($ses->sendEmail($m));
//发送邮件结果
print_r($ses->getSendQuota());
//摘要统计
print_r($ses->getSendStatistics());
//发送统计
//发邮件 base 64编码,针对中文
function address_encode($str)
{
    return '=?UTF-8?B?' . base64_encode($str) . '?=';
}
Пример #20
0
function send_webmail_byses($module, $to_email, $from_name, $from_email, $subject, $contents, $cc = '', $bcc = '', $attachment = '', $emailid = '')
{
    global $log, $access_key, $secret_key;
    $log->debug("Entering send_webmail_byses() method ...");
    require_once 'include/ses.php';
    $errMsg = "";
    if ($access_key != "" && $secret_key != "") {
        $ses = new SimpleEmailService($access_key, $secret_key);
        if (!isset($_SESSION["MAILLIST_PLAINTEXT"])) {
            $headertag = "<HEAD><META http-equiv=\"Content-Type\" content=\"text/html; charset=GBK\"></HEAD>";
            $contents = from_html($contents);
            $contents = eregi_replace('<BODY', $headertag . '<BODY', $contents);
        }
        $m = new SimpleEmailServiceMessage();
        $m->addTo($to_email);
        $m->setFrom($from_email);
        $m->setSubject($subject);
        $m->setMessageFromString($contents);
        $m->setSubjectCharset('GBK');
        $m->setMessageCharset('GBK');
        $errMsg = $ses->sendEmail($m);
        $log->debug("send_webmail_byses sendEmail result:" . $errMsg);
    }
    $log->debug("Exit send_webmail_byses() method ...");
    return $errMsg;
}
Пример #21
0
 function sendWelcomeRegistrationMail($register, $broker_id = "", $token = '', $userId = '')
 {
     $this->load->model('UserModel');
     $this->load->model('NewsLetterModel');
     $this->load->model('RoleModel');
     $this->load->library('parser');
     if ($register == "") {
         return false;
     }
     $user_details = $this->UserModel->getUserByEmail($register);
     $role_details = $this->RoleModel->getRoleWithEmail($register);
     $register_role = $role_details->label;
     $register_name = $user_details->first_name . ' ' . $user_details->middle_initial . ' ' . $user_details->last_name;
     $subject = 'Welcome to The Credit University';
     if ($broker_id) {
         $user = $this->UserModel->getUserByUserId($broker_id);
         $broker = $user->first_name . ' ' . $user->middle_initial . ' ' . $user->last_name;
     }
     $this->load->library('SimpleEmailService');
     $ses = new SimpleEmailService('AKIAISEC5PBG2F54VL4A', 'ZhRYSpKdUMLRrxPwy878UN+pJmnllAocdcYRpJwZ');
     $ses->enableVerifyPeer(false);
     $simpleEmailServiceMessage = new SimpleEmailServiceMessage();
     $sent = "";
     if (!empty($user->email)) {
         $simpleEmailServiceMessage->addTo($user->email);
         $simpleEmailServiceMessage->setFrom('The Credit University' . '<' . EMAILSENDER . '>');
         $simpleEmailServiceMessage->setSubject($subject);
         $today = date('Y-m-d');
         $data1 = array('subject' => 'Registered to The Credit University', 'date' => $today, 'registered' => $register, 'register_name' => $register_name, 'role' => $register_role, 'under_registered' => $broker);
         $code = $this->NewsLetterModel->getWelcomeLetterByShortCode(BROKER_WELCOME_TEMPLATE);
         if ($code != "") {
             $code = $this->parseTemplate($code, $data1);
             $simpleEmailServiceMessage->setMessageFromString('', $code);
             $sent = $ses->sendEmail($simpleEmailServiceMessage);
         }
     }
     $simpleEmailServiceMessage->addTo($register);
     $simpleEmailServiceMessage->setFrom('The Credit University' . '<' . EMAILSENDER . '>');
     $simpleEmailServiceMessage->setSubject($subject);
     $today = date('Y-m-d');
     $data = array('subject' => 'Registered to The Credit University', 'register_name' => $register_name, 'date' => $today, 'registered' => $register, 'role' => $register_role, 'under_registered' => $broker, 'token' => $token, 'user_id' => $userId);
     $code_register = $this->NewsLetterModel->getWelcomeLetterByShortCode(WELCOME_TEMPLATE);
     if ($code_register != "") {
         $code_register = $this->parseTemplate($code_register, $data);
         $simpleEmailServiceMessage->setMessageFromString('', $code_register);
         $sent = $ses->sendEmail($simpleEmailServiceMessage);
     }
     return $sent;
 }
Пример #22
0
			<td style="text-align: center; vertical-align: top; ">
				<strong><span style="font-size: 12px; color: rgb(0, 100, 0);"><span style="font-family: arial, helvetica, sans-serif; "><a href="http://www.xebura.com"><img src="http://s1.xebura.com/logo.gif?i=' . $eid . '&s=' . $cid . '" border="0"/></a><br />
				Sent with Xebura</span></span></strong></td>
		</tr>
	</tbody>
</table>
</body>
</html>';
                $final_subject = str_replace('{LNAME}', $lname, $subject);
                $m = new SimpleEmailServiceMessage();
                $m->addTo($email);
                $m->setFrom($from_label . " <" . $from_email . ">");
                //$m->setReturnPath($eid."_".$cid."*****@*****.**");
                //$m->setReturnPath('*****@*****.**');
                $m->setSubject($final_subject);
                $m->setMessageFromString('text' . $msg_txt, $html);
                $ses->sendEmail($m);
                $send_count++;
            }
        }
        ////update job as completed
        $end_time = date('Y-m-d G:i:s', strtotime("now"));
        //// update message job as completed
        $values = array(XE_JOB_STATUS => '5', XE_JOB_SEND_COUNT => $send_count, XE_JOB_ENDED_TIME => $end_time);
        //status 5 = finished
        $db->update("XEBURA_JOBS", $values, "WHERE XE_JOB_ID = '" . $jid . "'");
        //$values = array(XE_GROUP_LAST_LAUNCH_DATE => $end_time);
        $db->query("UPDATE XEBURA_EMAIL_GROUP SET XE_GROUP_LAST_LAUNCH_DATE = '" . $end_time . "' WHERE XE_ADDRESS_GROUP_ID IN(" . $gid . ")");
    }
}
echo 'Xebura sent all messages successfully';
Пример #23
0
 function supportEmail()
 {
     $clientOwner = array('Client', 'Owner');
     $result = array_intersect($clientOwner, $this->session->userdata(ROLES));
     if ($result) {
         $brokerId = $this->UserModel->getBrokerFromClientid($this->session->userdata(USER_ID));
         $brokerIdArray = array($brokerId);
         $brokerEmail[] = $this->UserModel->getEmailAddress($brokerId);
     }
     $adminUsers = $this->UserModel->getAdminUsers();
     foreach ($adminUsers as $userAdmin) {
         $receiverAdminId[] = $userAdmin->id;
         $receiverAdminEmail[] = $userAdmin->email;
     }
     if ($brokerIdArray) {
         $receiverId = array_unique(array_merge($receiverAdminId, $brokerIdArray));
         $receiverEmail = array_unique(array_merge($receiverAdminEmail, $brokerEmail));
     } else {
         $receiverId = $receiverAdminId;
         $receiverEmail = $receiverAdminEmail;
     }
     $emailId = $this->EmailModel->insertEmails('Success', $receiverId);
     $link = '<a href="' . base_url(ADMIN_PATH . "mail/read_mail/" . $emailId) . '" target="_blank">here</a>';
     $emailMessage = "You've received email from " . $this->session->userdata(NAME) . ". Click " . $link . " to view the message.";
     $subject = $this->input->post('subject');
     $message = $emailMessage;
     $this->load->library('SimpleEmailService');
     $ses = new SimpleEmailService('AKIAISEC5PBG2F54VL4A', 'ZhRYSpKdUMLRrxPwy878UN+pJmnllAocdcYRpJwZ');
     $ses->enableVerifyPeer(false);
     $m = new SimpleEmailServiceMessage();
     $m->addTo(EMAILSENDER);
     $m->addCC($receiverEmail);
     $m->setFrom($this->name . ' via Credit University' . '<' . EMAILSENDER . '>');
     $m->setSubject($subject);
     $msg = $message;
     $m->setMessageFromString('', $msg);
     $ses->sendEmail($m);
     $this->session->set_flashdata("supportMessage", "Support & Suggestion email has been sent successfully.");
     redirect(ADMIN_PATH);
 }