Changeset 2940 for trunk/expressoMail1_2/inc/class.phpmailer.php
- Timestamp:
- 06/17/10 09:54:11 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.phpmailer.php
r2795 r2940 542 542 for($i = 0; $i < count($this->to); $i++) 543 543 { 544 if($this->valEm($this->to[$i][0])) 545 { 546 if(!$this->smtp->Recipient($this->to[$i][0])) $bad_rcpt[] = $this->to[$i][0]; 547 } 548 else 549 { 550 $errorx .= $this->to[$i][0] . ', '; 551 } 544 if(!$this->smtp->Recipient($this->to[$i][0])) 545 $bad_rcpt[] = $this->to[$i][0]; 552 546 } 553 547 for($i = 0; $i < count($this->cc); $i++) 554 548 { 555 if($this->valEm($this->cc[$i][0])) 556 { 557 if(!$this->smtp->Recipient($this->cc[$i][0])) $bad_rcpt[] = $this->cc[$i][0]; 558 } 559 else 560 { 561 $errorx .= $this->cc[$i][0] . ', '; 562 } 549 if(!$this->smtp->Recipient($this->cc[$i][0])) 550 $bad_rcpt[] = $this->cc[$i][0]; 563 551 } 564 552 for($i = 0; $i < count($this->bcc); $i++) 565 553 { 566 if($this->valEm($this->bcc[$i][0])) 567 { 568 if(!$this->smtp->Recipient($this->bcc[$i][0])) $bad_rcpt[] = $this->bcc[$i][0]; 569 } 570 else 571 { 572 $errorx .= $this->bcc[$i][0] . ', '; 573 } 554 if(!$this->smtp->Recipient($this->bcc[$i][0])) 555 $bad_rcpt[] = $this->bcc[$i][0]; 574 556 } 575 557 if($errorx != '') … … 743 725 744 726 return $smtpSent; 745 }746 747 function valEm($email)748 {749 $mail_retorno = FALSE;750 if ((strlen($email) >= 2) && (substr_count($email,"@") == 1) && (substr($email,0,1) != "@") && (substr($email,strlen($email)-1,1) != "@"))751 {752 if ((!strstr($email,"'")) && (!strstr($email,"\"")) && (!strstr($email,"\\")) && (!strstr($email,"\$")) && (!strstr($email," ")))753 {754 //testa se tem caracter .755 if (substr_count($email,".")>= 1)756 {757 //obtem a terminação do dominio758 $term_dom = substr(strrchr ($email, '.'),1);759 //verifica se terminação do dominio esta correcta760 if (strlen($term_dom)>1 && strlen($term_dom)<9 && (!strstr($term_dom,"@")) )761 {762 $antes_dom = substr($email,0,strlen($email) - strlen($term_dom) - 1);763 $caracter_ult = substr($antes_dom,strlen($antes_dom)-1,1);764 if ($caracter_ult != "@" && $caracter_ult != ".")765 {766 $mail_retorno = TRUE;767 }768 }769 }770 }771 }772 return $mail_retorno;773 727 } 774 728
Note: See TracChangeset
for help on using the changeset viewer.