Changeset 21514 for branches/version-2_12-dev/data/class/SC_SendMail.php
- Timestamp:
- 2012/02/15 19:56:17 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/SC_SendMail.php
r21490 r21514 37 37 function SC_SendMail() { 38 38 $this->arrRecip = array(); 39 $this->to = "";40 $this->subject = "";41 $this->body = "";42 $this->cc = "";43 $this->bcc = "";44 $this->replay_to = "";45 $this->return_path = "";39 $this->to = ''; 40 $this->subject = ''; 41 $this->body = ''; 42 $this->cc = ''; 43 $this->bcc = ''; 44 $this->replay_to = ''; 45 $this->return_path = ''; 46 46 $this->backend = MAIL_BACKEND; 47 47 $this->host = SMTP_HOST; … … 60 60 61 61 // 宛先の設定 62 function setTo($to, $to_name = "") {63 if ($to != "") {62 function setTo($to, $to_name = '') { 63 if ($to != '') { 64 64 $this->to = $this->getNameAddress($to_name, $to); 65 65 $this->setRecip('To', $to); … … 68 68 69 69 // 送信元の設定 70 function setFrom($from, $from_name = "") {70 function setFrom($from, $from_name = '') { 71 71 $this->from = $this->getNameAddress($from_name, $from); 72 72 } 73 73 74 74 // CCの設定 75 function setCc($cc, $cc_name = "") {76 if ($cc != "") {75 function setCc($cc, $cc_name = '') { 76 if ($cc != '') { 77 77 $this->cc = $this->getNameAddress($cc_name, $cc); 78 78 $this->setRecip('Cc', $cc); … … 82 82 // BCCの設定 83 83 function setBCc($bcc) { 84 if ($bcc != "") {84 if ($bcc != '') { 85 85 $this->bcc = $bcc; 86 86 $this->setRecip('Bcc', $bcc); … … 90 90 // Reply-Toの設定 91 91 function setReplyTo($reply_to) { 92 if ($reply_to != "") {92 if ($reply_to != '') { 93 93 $this->reply_to = $reply_to; 94 94 } … … 138 138 // 名前<メールアドレス>の形式を生成 139 139 function getNameAddress($name, $mail_address) { 140 if ($name != "") {140 if ($name != '') { 141 141 // 制御文字を変換する。 142 142 $_name = $name; 143 $_name = ereg_replace( "<","<", $_name);144 $_name = ereg_replace( ">",">", $_name);143 $_name = ereg_replace('<','<', $_name); 144 $_name = ereg_replace('>','>', $_name); 145 145 $_name = mb_encode_mimeheader($_name, 'JIS', 'B', "\n"); 146 146 $name_address = "\"". $_name . "\"<" . $mail_address . ">"; … … 151 151 } 152 152 153 function setItem($to, $subject, $body, $fromaddress, $from_name, $reply_to= "", $return_path="", $errors_to="", $bcc="", $cc ="") {153 function setItem($to, $subject, $body, $fromaddress, $from_name, $reply_to='', $return_path='', $errors_to="", $bcc="", $cc ="") { 154 154 $this->setBase($to, $subject, $body, $fromaddress, $from_name, $reply_to, $return_path, $errors_to, $bcc, $cc); 155 155 } 156 156 157 function setItemHtml($to, $subject, $body, $fromaddress, $from_name, $reply_to= "", $return_path="", $errors_to="", $bcc="", $cc ="") {157 function setItemHtml($to, $subject, $body, $fromaddress, $from_name, $reply_to='', $return_path='', $errors_to="", $bcc="", $cc ="") { 158 158 $this->setBase($to, $subject, $body, $fromaddress, $from_name, $reply_to, $return_path, $errors_to, $bcc, $cc); 159 159 } … … 171 171 $bcc -> ブラインドカーボンコピー 172 172 */ 173 function setBase($to, $subject, $body, $fromaddress, $from_name, $reply_to= "", $return_path="", $errors_to="", $bcc="", $cc ="") {173 function setBase($to, $subject, $body, $fromaddress, $from_name, $reply_to='', $return_path='', $errors_to="", $bcc="", $cc ="") { 174 174 // 宛先設定 175 175 $this->setTo($to); … … 188 188 189 189 // Errors-Toは、ほとんどのSMTPで無視され、Return-Pathが優先されるためReturn_Pathに設定する。 190 if ($errors_to != "") {190 if ($errors_to != '') { 191 191 $this->return_path = $errors_to; 192 } else if ($return_path != "") {192 } else if ($return_path != '') { 193 193 $this->return_path = $return_path; 194 194 } else { … … 205 205 $arrHeader['From'] = $this->from; 206 206 $arrHeader['Return-Path'] = $this->return_path; 207 if ($this->reply_to != "") {207 if ($this->reply_to != '') { 208 208 $arrHeader['Reply-To'] = $this->reply_to; 209 209 } 210 if ($this->cc != "") {210 if ($this->cc != '') { 211 211 $arrHeader['Cc'] = $this->cc; 212 212 } 213 if ($this->bcc != "") {213 if ($this->bcc != '') { 214 214 $arrHeader['Bcc'] = $this->bcc; 215 215 } 216 $arrHeader['Date'] = date( "D, j M Y H:i:s O");216 $arrHeader['Date'] = date('D, j M Y H:i:s O'); 217 217 return $arrHeader; 218 218 } … … 230 230 $arrHeader = $this->getBaseHeader(); 231 231 $arrHeader['Content-Type'] = "text/html; charset=\"ISO-2022-JP\""; 232 $arrHeader['Content-Transfer-Encoding'] = "ISO-2022-JP";232 $arrHeader['Content-Transfer-Encoding'] = 'ISO-2022-JP'; 233 233 return $arrHeader; 234 234 }
Note: See TracChangeset
for help on using the changeset viewer.