- Timestamp:
- 06/17/10 09:49:54 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/expressoMail1_2/inc/class.phpmailer.php
r1247 r2938 525 525 for($i = 0; $i < count($this->to); $i++) 526 526 { 527 if($this->valEm($this->to[$i][0])) 528 { 529 if(!$this->smtp->Recipient($this->to[$i][0])) $bad_rcpt[] = $this->to[$i][0]; 530 } 531 else 532 { 533 $errorx .= $this->to[$i][0] . ', '; 534 } 527 if(!$this->smtp->Recipient($this->to[$i][0])) 528 $bad_rcpt[] = $this->to[$i][0]; 535 529 } 536 530 for($i = 0; $i < count($this->cc); $i++) 537 531 { 538 if($this->valEm($this->cc[$i][0])) 539 { 540 if(!$this->smtp->Recipient($this->cc[$i][0])) $bad_rcpt[] = $this->cc[$i][0]; 541 } 542 else 543 { 544 $errorx .= $this->cc[$i][0] . ', '; 545 } 532 if(!$this->smtp->Recipient($this->cc[$i][0])) 533 $bad_rcpt[] = $this->cc[$i][0]; 546 534 } 547 535 for($i = 0; $i < count($this->bcc); $i++) 548 536 { 549 if($this->valEm($this->bcc[$i][0])) 550 { 551 if(!$this->smtp->Recipient($this->bcc[$i][0])) $bad_rcpt[] = $this->bcc[$i][0]; 552 } 553 else 554 { 555 $errorx .= $this->bcc[$i][0] . ', '; 556 } 537 if(!$this->smtp->Recipient($this->bcc[$i][0])) 538 $bad_rcpt[] = $this->bcc[$i][0]; 557 539 } 558 540 if($errorx != '') … … 726 708 727 709 return $smtpSent; 728 }729 730 function valEm($email)731 {732 $mail_retorno = FALSE;733 if ((strlen($email) >= 6) && (substr_count($email,"@") == 1) && (substr($email,0,1) != "@") && (substr($email,strlen($email)-1,1) != "@"))734 {735 if ((!strstr($email,"'")) && (!strstr($email,"\"")) && (!strstr($email,"\\")) && (!strstr($email,"\$")) && (!strstr($email," ")))736 {737 //testa se tem caracter .738 if (substr_count($email,".")>= 1)739 {740 //obtem a terminação do dominio741 $term_dom = substr(strrchr ($email, '.'),1);742 //verifica se terminação do dominio esta correcta743 if (strlen($term_dom)>1 && strlen($term_dom)<5 && (!strstr($term_dom,"@")) )744 {745 $antes_dom = substr($email,0,strlen($email) - strlen($term_dom) - 1);746 $caracter_ult = substr($antes_dom,strlen($antes_dom)-1,1);747 if ($caracter_ult != "@" && $caracter_ult != ".")748 {749 $mail_retorno = TRUE;750 }751 }752 }753 }754 }755 return $mail_retorno;756 710 } 757 711
Note: See TracChangeset
for help on using the changeset viewer.