if ($isPcSend) { $mailData = array("to_address" => $val["pc_address"], "return_path" => $return, "from_address" => $listValue["from_address"], "from_name" => $fromName, "subject" => $pcSubject, "text_body" => $pcTextBody, "html_body" => $pcHtmlBody); $mailElements = $AdmMailMagazineOBJ->convertMailElements($mailData, $val["user_id"], $convertAry); $sendMailData = $AdmMailMagazineOBJ->smtpMailTo($mailElements, $second, $pcImageData, $pcImageType); if ($sendMailData) { try { $sendResult = ""; if ($val["pc_mailmagazine_from_domain_id"] >= $lastMailDomainKey and !$listValue["reverse_mail_status"] and !$val["is_pc_reverse"]) { // 通常 $sendResult = $normalComSendMagicDeliveryOBJ->sendMagicDelivery($sendMailData); } elseif (!$listValue["reverse_mail_status"] && !$val["is_pc_reverse"]) { // 通常 $sendResult = $normalComSendMagicDeliveryOBJ->sendMagicDelivery($sendMailData); } elseif ($listValue["reverse_mail_status"] || $val["is_pc_reverse"]) { // 反転 $sendResult = $reverseComSendMagicDeliveryOBJ->sendMagicDelivery($sendMailData); } if (!$sendResult) { $sendCnt["notSendPcCnt"]++; $isPcSend = false; } } catch (Zend_Exception $e) { // 送れたものとして判断 // デバッグメール $debugMail = ""; $debugMail["subject"] = "定期メルマガ送信エラー"; $debugMail["text_body"][] = "file:" . __FILE__; $debugMail["text_body"][] = "line:" . __LINE__; $debugMail["text_body"][] = "mailmagine_log.id:" . $mailMagaId; $debugMail["text_body"][] = "user.id:" . $val["user_id"]; $debugMail["text_body"][] = "send_device_type:PC";
/** * operationMailToメソッド(SMTP) * * 運営へメール送信実行 * * @param array $mailElements 送信する要素 * [return_path] :リターンアドレス(任意) * [subject] :メールタイトル * [text_body] :メール本文(テキスト) * [html_body] :メール本文(HTML)(任意) * @return 送信成功:True 送信失敗:False */ public function operationMailTo($mailElements, $sec = 0) { if (!isset($mailElements)) { return FALSE; } // http通信 //送信用にエンコード $sendSubject = $mailElements["subject"]; $sendTextBody = htmlspecialchars_decode($mailElements["text_body"], ENT_QUOTES); //$sendHtmlBody = base64_encode($mailElements["html_body"]); // 送信項目の設定 $postdata["to"] = self::OPERATION_MAIL_ACCOUNT . $this->_configOBJ->define->MAIL_DOMAIN; $postdata["rtn_path"] = $mailElements["return_path"] ? $mailElements["return_path"] : self::RETURN_PATH . $this->_configOBJ->define->MAIL_DOMAIN; $postdata["from"] = "root@" . $this->_configOBJ->define->MAIL_DOMAIN; $postdata["from_nm"] = $this->_configOBJ->define->SITE_NAME; $postdata["sbj"] = $sendSubject; $postdata["body"] = $sendTextBody; $postdata["html"] = $mailElements["html_body"]; $postdata["sec"] = $sec; // リメール用インスタンス生成 $operationMailComSendMagicDeliveryOBJ = new ComSendMagicDelivery(); // SMTPホスト設定(SendMagic) $operationMailComSendMagicDeliveryOBJ->setSendMailServerIp($this->_configOBJ->common_config->smtp_mail_server_ip->sendMagic); // SMTP接続開始 if (!$operationMailComSendMagicDeliveryOBJ->openSmtpConnect()) { return false; } // 送信メールデータ生成 $sendMailData = $postdata; $smtpSendResult = true; if ($sendMailData) { // リメール送信 if (!$operationMailComSendMagicDeliveryOBJ->sendMagicDelivery($sendMailData)) { $smtpSendResult = false; } } else { $smtpSendResult = false; } // SMTP切断 $operationMailComSendMagicDeliveryOBJ->closeSmtpConnect(); return $smtpSendResult; }
/** * mailToメソッド * * メール送信実行 * * @param string $mailAddress 送信するメアド * @param array $$mailElements 送信する要素 * [from_address]:メール送信元アドレス * [from_name] :メール送信元名(任意) * [return_path] :リターンアドレス(任意) * [subject] :メールタイトル * [text_body] :メール本文(テキスト) * [html_body] :メール本文(HTML)(任意) * @return 送信成功:True 送信失敗:False */ public function mailTo($mailElements, $sec = 0, $imageData = null, $imageType = null) { $AdmMailMagazineOBJ = AdmMailMagazine::getInstance(); //return $AdmMailMagazineOBJ->mailTo($mailElements, $sec, $imageData, $imageType); $sendMailData = $AdmMailMagazineOBJ->smtpMailTo($mailElements, $sec, $imageData, $imageType); // リメール用インスタンス生成 $contactComSendMagicDeliveryOBJ = new ComSendMagicDelivery(); // SMTPホスト設定(SendMagic) $contactComSendMagicDeliveryOBJ->setSendMailServerIp($this->_configOBJ->common_config->smtp_mail_server_ip->sendMagic); // SMTP接続開始 if (!$contactComSendMagicDeliveryOBJ->openSmtpConnect()) { return false; } $smtpSendResult = true; if ($sendMailData) { // リメール送信 if (!$contactComSendMagicDeliveryOBJ->sendMagicDelivery($sendMailData)) { $smtpSendResult = false; } } else { $smtpSendResult = false; } // SMTP切断 $contactComSendMagicDeliveryOBJ->closeSmtpConnect(); return $smtpSendResult; }
if ($sendMailDomainArray[$val["mb_mailmagazine_from_domain_id"]]) { $listValue["from_address"] = $fromAddressAry[0] . "@" . $sendMailDomainArray[$val["mb_mailmagazine_from_domain_id"]]; } else { $listValue["from_address"] = $fromAddressAry[0] . "@" . $_config["define"]["MAIL_DOMAIN"]; } } if ($isMbSend) { $mailData = array("to_address" => $val["mb_address"], "return_path" => $return, "from_address" => $listValue["from_address"], "from_name" => $fromName, "subject" => $mbSubject, "text_body" => $mbTextBody, "html_body" => $mbHtmlBody); $mailElements = $AdmMailMagazineOBJ->convertMailElements($mailData, $val["user_id"], $convertAry); $sendMailData = $AdmMailMagazineOBJ->smtpMailTo($mailElements, $second, $mbImageData, $mbImageType); if ($sendMailData) { try { $sendResult = ""; if ($val["mb_mailmagazine_from_domain_id"] >= $lastMailDomainKey and !$listValue["reverse_mail_status"] and !$val["is_mb_reverse"]) { // 通常 $sendResult = $normalComSendMagicDeliveryMbOBJ->sendMagicDelivery($sendMailData); } elseif (!$listValue["reverse_mail_status"] && !$val["is_mb_reverse"]) { // 通常 $sendResult = $normalComSendMagicDeliveryMbOBJ->sendMagicDelivery($sendMailData); } elseif ($listValue["reverse_mail_status"] || $val["is_mb_reverse"]) { // 反転 $sendResult = $normalComSendMagicDeliveryMbOBJ->sendMagicDelivery($sendMailData); } if (!$sendResult) { $sendCnt["notSendMbCnt"]++; $isMbSend = false; } } catch (Zend_Exception $e) { // 送れたものとして判断 // デバッグメール $debugMail = "";