ugrás a tartalomhoz

PHPMailer cím hozzáadása nem sikerül

cszlak · 2012. Már. 5. (H), 22.29
  1. require 'class.phpmailer.php';  
  2. $email_cim = $mail['email'];  
  3. $mail = new PHPMailer();    
  4.     
  5. $mail->SetFrom("no-reply##kukac##domain.com","domain");    
  6.  // Feladó e-mail címe Feladó neve       
  7. $mail->AddAddress($email_cim);                // Címzett és neve    
  8. $mail->AddReplyTo("no-reply##kukac##domain.com","Newsletter");  // Válaszlevél ide    
  9. $mail->IsHTML(true);                                 // Küldés HTML-ként    
  10. $mail->Subject = $_POST['targy'];                    // A levél tárgya    
  11. $mail->Body   = tartaloma($tartalom);    // A levél tartalma    
  12.   
  13. if (!$mail->Send()) {   
  14.    $siker = 0;   
  15.    $hiba = "A levél nem került elküldésre! "." A felmerült hiba: "$mail->ErrorInfo;   
  16.      
  17. }    
A problémám a:
$mail->AddAddress($email_cim)
résszel van.

Valamiért nem tölti be az email címet. Lefut hiba nélkül de nem küldi el az emailt.
A tárhely csak az SMTP levelet küldi el, és az be is van állítva hiba nélkül.
 
1

Az egész?

janoszen · 2012. Már. 6. (K), 00.34
Ez az egész script vagy lehagytál valamit? Mi ad a $mail változónak értéket?
2

$mail

cszlak · 2012. Már. 6. (K), 12.00
A friend_mail() függvény:
  1. function friend_mail($reply_mail,$sender_mail,$emails,$address_mail,$subject,$message){  
  2. $return = false;  
  3. $mail = new PHPMailer();  //Friend\'s email       
  4.                 
  5. $mail->SetFrom($reply_mail,$sender_mail);            //Feladó és neve  
  6. $mail->AddAddress($emails,$address_mail);       // Címzett és neve    
  7. $mail->AddReplyTo($reply_mail,$address_mail);  // Válaszlevél ide    
  8. $mail->IsHTML(true);                                 // Küldés HTML-ként    
  9. $mail->Subject = $subject;                       // A levél tárgya    
  10. $mail->Body   = $message;                          // A levél tartalma    
  11. if ($mail->Send()) {   // Friend\'s email  
  12.  $return = true;  
  13. }  
  14. else{  
  15.  echo " Error: "$mail->ErrorInfo. "<br />";   
  16.   $return = false;  
  17.  }  
  18. return($return);   
  19. }   
Bocsánat itt a kód eleje:
  1. $uzenet = "";  
  2.     $sender_mail = $_POST["mail_sender"]; //Name  
  3.     $reply_mail = $_POST["mail_reply"];   //email  
  4.       
  5.     $cimek[] = $_POST['mail_user1'];  //friends  
  6.     $cimek[] = $_POST['mail_user2'];  
  7.     $cimek[] = $_POST['mail_user3'];  
  8.     $cimek[] = $_POST['mail_user4'];  
  9.     $cimek[] = $_POST['mail_user5'];  
  10.     $cimek[] = $_POST['mail_user6'];  
  11.     $cimek[] = $_POST['mail_user7'];  
  12.     $cimek[] = $_POST['mail_user8'];  
  13.     $cimek[] = $_POST['mail_user9'];  
  14.     $cimek[] = $_POST['mail_user10'];  
  15.   
  16.   
  17.     $egyedi = array_unique($cimek);  //vizsgálat  
  18. if ( count($egyedi) != count($cimek) )   
  19. {  
  20. $uzenet =  ' You must type in different e-mail addresses!';  
  21. ezaz($uzenet);  
  22.  $error = 1;  
  23. }  
  24.   
  25. if ( count($reply_mail) != count($cimek) )  
  26. {  
  27. $uzenet =  'Please, do not put your own e-mail address here!';  
  28. ezaz($uzenet);  
  29.  $error = 1;  
  30. }  
  31.   
  32.     $error = 0;  
  33.   
  34. $message = ezmegaz($sender_mail); //reklám üzenet            
  35.     //$mail3 = new PHPMailer();  //Friend\'s email  
  36.      $subject = "Friend\'s email";  
  37.     $publicity = "$sender_mail :"." the $reply_mail ."  
  38.                . "<br /><br />"   
  39.                ."Friend\'s email addresses:"  
  40.                . "<br /><br />";  
  41.     $address_mail = 'Friend\'s email';  
  42.        
  43.     for($n = 0; $n != 10 ; $n++  ){  
  44.       
  45.     $emails ='';  
  46.     $emails = $cimek[$n] ;  
  47.          
  48.       
  49.      if(checkemail1($emails)){   
  50.         
  51.     if(friend_mail($reply_mail,$sender_mail,$emails,$address_mail,$subject,$message))     
  52.     {    $publicity .= " $emails " . "<br /><br />";}  
  53.     elseecho " Error mail: "$mail->ErrorInfo. "<br />"; }  
  54.      
  55.     }//if end  
  56.      else{  
  57.      $error = 1;  
  58.      $uzenet = ' You must type in different e-mail addresses!';  
  59.      }   
  60.   
  61.     }//for     
A problémám, hogy az $emails - ban benne van az email cím amre küldeni kellene az emailt, de az AddAdres nem veszi be.
3

Megoldódott köszönöm.

cszlak · 2012. Már. 6. (K), 13.09
Megoldódott köszönöm.
4

És hogyan

Pepita · 2012. Már. 6. (K), 20.37
oldódott meg? Hadd lássák mások is!