Created
May 28, 2015 09:07
-
-
Save atsu666/379a1535148c58fd461b to your computer and use it in GitHub Desktop.
メールの送信(添付ファイル付)a-blog cms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <php | |
| ... | |
| if ( 1 | |
| and $to = $Mail->getArray('AdminTo') | |
| and $subjectTpl = findTemplate($Mail->get('AdminSubjectTpl')) | |
| and $bodyTpl = findTemplate($Mail->get('AdminBodyTpl')) | |
| ) { | |
| $Mail->set('adminSubject', $this->getMailTxt($subjectTpl, $Field)); | |
| $Mail->set('adminBody', $this->getMailTxt($bodyTpl, $Field)); | |
| $FormMail = new ACMS_POST_Form_Mail($this->mailConfig()); | |
| $FormMail->setHeaderReturnPath(); | |
| $FormMail->setHeaderDate(); | |
| $FormMail->setHeaderMessageId(); | |
| $FormMail->setHeader('Sender', $sender); | |
| $FormMail->setHeader('From', $Mail->getArray('AdminFrom')); | |
| $FormMail->setHeader('To', $to); | |
| $FormMail->setHeader('Subject', $Mail->get('adminSubject')); | |
| $FormMail->setHeader('Cc', $Mail->getArray('AdminCc')); | |
| $FormMail->setHeader('Bcc', $Mail->getArray('AdminBcc')); | |
| $FormMail->setHeader('Reply-To', $Mail->getArray('AdminReply-To')); | |
| $FormMail->setHeader('MIME-Version', '1.0'); | |
| if ( file_exists($temppath) && is_file($temppath) ) { | |
| $FormMail->addFile($temppath); | |
| } | |
| $FormMail->setHeader('Content-Type', 'multipart/mixed', array( | |
| 'boundary' => 'ablogcms-'.uniqueString(), | |
| )); | |
| $Plain =& new Mail(); | |
| $Plain->setHeader('Content-Type', 'text/plain', array( | |
| 'charset' => $charset, | |
| )); | |
| $Plain->setHeader('Content-Transfer-Encoding', ('ISO-2022-JP' == $charset) ? '7bit' : 'base64'); | |
| $Plain->setBody($Mail->get('adminBody')); | |
| $FormMail->addBody($Plain); | |
| $FormMail->send(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment