Changeset 18866
- Timestamp:
- 2010/10/27 00:41:36 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/class/SC_SendMail.php
r18701 r18866 247 247 } 248 248 249 // 送信先を返す 249 /** 250 * メーラーバックエンドに応じた送信先を返す 251 * 252 * @return array|string メーラーバックエンドに応じた送信先 253 */ 250 254 function getRecip() { 251 255 switch ($this->backend) { 256 // PEAR::Mail_mail#send は、(他のメーラーバックエンドと異なり) 第1引数を To: として扱う。Cc: や Bcc: は、ヘッダー情報から処理する。 252 257 case "mail": 253 258 return $this->to; … … 265 270 * 266 271 * 設定された情報を利用して, メールを送信する. 267 * メールの宛先に Cc や Bcc が設定されていた場合は, 宛先ごとに複数回送信を行う.268 *269 * - getRecip() 関数の返り値が配列の場合は, 返り値のメールアドレスごとに,270 * PEAR::Mail::send() 関数を実行する.271 * - getRecip() 関数の返り値が string の場合は, 返り値のメールアドレスを272 * RCPT TO: に設定し, PEAR::Mail::send() 関数を実行する.273 272 * 274 273 * @return void 275 274 */ 276 function sendMail( ) {277 $header = $ this->getTEXTHeader();275 function sendMail($isHtml = false) { 276 $header = $isHtml ? $this->getHTMLHeader() : $this->getTEXTHeader(); 278 277 $recip = $this->getRecip(); 279 280 278 // メール送信 281 if (is_array($recip)) { 282 foreach ($recip as $rcpt_to) { 283 $results[] = $this->objMail->send($rcpt_to, $header, $this->body); 284 } 285 } else { 286 $results[] = $this->objMail->send($recip, $header, $this->body); 287 } 288 289 $ret = true; 290 foreach ($results as $result) { 279 $result = $this->objMail->send($recip, $header, $this->body); 291 280 if (PEAR::isError($result)) { 292 281 GC_Utils_Ex::gfPrintLog($result->getMessage()); 293 282 GC_Utils_Ex::gfDebugLog($header); 294 $ret =false;283 return false; 295 284 } 296 } 297 return $ret; 298 } 299 300 // HTMLメール送信を実行する 285 return true; 286 } 287 288 /** 289 * HTMLメール送信を実行する. 290 * 291 * @return void 292 */ 301 293 function sendHtmlMail() { 302 $header = $this->getHTMLHeader(); 303 // メール送信 304 $result = $this->objMail->send($this->getRecip(), $header, $this->body); 305 if (PEAR::isError($result)) { 306 GC_Utils_Ex::gfPrintLog($result->getMessage()); 307 GC_Utils_Ex::gfDebugLog($header); 308 return false; 309 } 310 return true; 294 return($this->sendMail(true)); 311 295 } 312 296
Note: See TracChangeset
for help on using the changeset viewer.