How can I use $mail->SMTPDebug as a string?
<p>I want to echo "Fail" if strlen $mail->SMTPDebug is more than 10. But I don't know how to use $mail->SMTPDebug as a string. The below line in the function enables the debugging. </p>

<pre><code>$mail-&gt;SMTPDebug  = 1;     
</code></pre>

<p>But can't use my if statement on it in my function. How can I do that ?</p>

<pre><code>function mailsender($val,$yollayan,$sifresi,$name,$subject,$message) {

$mail = new PHPMailer();  
$mail-&gt;IsSMTP();               
$mail-&gt;SMTPDebug  = 1;          
$mail-&gt;SMTPAuth = true;         
$mail-&gt;SMTPSecure = "tls";      

$mail-&gt;Username   = $yollayan;
$mail-&gt;Password   = $sifresi;

$mail-&gt;Host = "smtp.live.com";  
$mail-&gt;Port = "587";  


$mail-&gt;From = $yollayan;
$mail-&gt;Fromname = $name;
$mail-&gt;name = $name;


$mail-&gt;Subject = $subject;  
$mail-&gt;Body = $message;  
$mail-&gt;AddAddress($val);   
$mail-&gt;send();

}
</code></pre>
