Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 10th, 2012  |  syntax: None  |  size: 1.33 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How can I use $mail->SMTPDebug as a string?
  2. $mail->SMTPDebug  = 1;
  3.        
  4. function mailsender($val,$yollayan,$sifresi,$name,$subject,$message) {
  5.  
  6. $mail = new PHPMailer();  
  7. $mail->IsSMTP();              
  8. $mail->SMTPDebug  = 1;          
  9. $mail->SMTPAuth = true;        
  10. $mail->SMTPSecure = "tls";      
  11.  
  12. $mail->Username   = $yollayan;
  13. $mail->Password   = $sifresi;
  14.  
  15. $mail->Host = "smtp.live.com";  
  16. $mail->Port = "587";  
  17.  
  18.  
  19. $mail->From = $yollayan;
  20. $mail->Fromname = $name;
  21. $mail->name = $name;
  22.  
  23.  
  24. $mail->Subject = $subject;  
  25. $mail->Body = $message;  
  26. $mail->AddAddress($val);  
  27. $mail->send();
  28.  
  29. }
  30.        
  31. class MyPHPMailer extends PHPMailer {
  32.  
  33.   public $DbgOut = '';
  34.  
  35.   private function edebug($str) {
  36.     $this->DbgOut .= $str;
  37.   }
  38.  
  39. }
  40.        
  41. function mailsender($val, $yollayan, $sifresi, $name, $subject, $message) {
  42.  
  43.   $mail = new MyPHPMailer();  
  44.   $mail->IsSMTP();              
  45.   $mail->SMTPDebug  = 1;          
  46.   $mail->SMTPAuth = true;        
  47.   $mail->SMTPSecure = "tls";      
  48.  
  49.   $mail->Username   = $yollayan;
  50.   $mail->Password   = $sifresi;
  51.  
  52.   $mail->Host = "smtp.live.com";  
  53.   $mail->Port = "587";  
  54.  
  55.  
  56.   $mail->From = $yollayan;
  57.   $mail->Fromname = $name;
  58.   $mail->name = $name;
  59.  
  60.  
  61.   $mail->Subject = $subject;  
  62.   $mail->Body = $message;  
  63.   $mail->AddAddress($val);
  64.   $mail->send();
  65.  
  66.   if(strlen($mail->DbgOut) > 10)
  67.     echo 'Failed'.PHP_EOL;
  68.  
  69. }