Changeset 16321
- Timestamp:
- 2007/10/07 17:32:40 (16 years ago)
- Location:
- branches/feature-module-update
- Files:
-
- 3 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-module-update/data/class/GC_SendMail.php
r16303 r16321 39 39 $this->objMailMime = new Mail_mime(); 40 40 mb_language( "Japanese" ); 41 $this->arrTEXTEncode['text_charset'] = "ISO-2022-JP";42 $this->arrHTMLEncode['head_charset'] = "ISO-2022-JP";43 $this->arrHTMLEncode['html_encoding'] = "ISO-2022-JP";44 $this->arrHTMLEncode['html_charset'] = "ISO-2022-JP";45 41 $arrHost = array( 46 42 'host' => $this->host, … … 186 182 187 183 // ヘッダーを返す 188 function get Header() {184 function getBaseHeader() { 189 185 //-- 送信するメールの内容と送信先 186 $arrHeader['MIME-Version'] = '1.0'; 190 187 $arrHeader['To'] = $this->to; 191 188 $arrHeader['Subject'] = $this->subject; … … 207 204 } 208 205 206 // ヘッダーを返す 207 function getTEXTHeader() { 208 $arrHeader = $this->getBaseHeader(); 209 $arrHeader['Content-Type'] = "text/plain; charset=\"ISO-2022-JP\""; 210 $arrHeader['Content-Transfer-Encoding'] = "7bit"; 211 return $arrHeader; 212 } 213 214 // ヘッダーを返す 215 function getHTMLHeader() { 216 $arrHeader = $this->getBaseHeader(); 217 $arrHeader['Content-Type'] = "text/html; charset=\"ISO-2022-JP\""; 218 $arrHeader['Content-Transfer-Encoding'] = "ISO-2022-JP"; 219 return $arrHeader; 220 } 221 209 222 // TXTメール送信を実行する 210 223 function sendMail() { 211 $this->objMailMime->setTXTBody($this->body); 212 $body = $this->objMailMime->get($this->arrTEXTEncode); 213 $header = $this->getHeader(); 224 $header = $this->getTEXTHeader(); 214 225 // メール送信 215 $result = $this->objMail->send($this->to, $header, $ body);226 $result = $this->objMail->send($this->to, $header, $this->body); 216 227 if (PEAR::isError($result)) { 217 228 GC_Utils_Ex::gfPrintLog($result->getMessage()); … … 219 230 return false; 220 231 } 221 return true; 232 return true; 222 233 } 223 234 224 235 // HTMLメール送信を実行する 225 236 function sendHtmlMail() { 226 $this->objMailMime->setHTMLBody($this->body); 227 $body = $this->objMailMime->get($this->arrHTMLEncode); 228 $header = $this->getHeader(); 237 $header = $this->getHTMLHeader(); 229 238 // メール送信 230 $result = $this->objMail->send($this->to, $header, $ body);239 $result = $this->objMail->send($this->to, $header, $this->body); 231 240 if (PEAR::isError($result)) { 232 241 GC_Utils_Ex::gfPrintLog($result->getMessage()); -
branches/feature-module-update/html/test/naka/mail.php
r16308 r16321 8 8 //-- 送信するメールの内容と送信先 9 9 $sendResut = array( 10 "to" => ' abnana210@softbank.ne.jp', // 顧客宛先10 "to" => 'naka@lockon.co.jp', // 顧客宛先 11 11 "Subject" => mb_encode_mimeheader("てすと"), // Subject 12 12 "From" => 'test01@lockon.co.jp', // 送信元メールアドレス
Note: See TracChangeset
for help on using the changeset viewer.