
Untitled
By: a guest on
Aug 10th, 2012 | syntax:
None | size: 1.33 KB | hits: 13 | expires: Never
How can I use $mail->SMTPDebug as a string?
$mail->SMTPDebug = 1;
function mailsender($val,$yollayan,$sifresi,$name,$subject,$message) {
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug = 1;
$mail->SMTPAuth = true;
$mail->SMTPSecure = "tls";
$mail->Username = $yollayan;
$mail->Password = $sifresi;
$mail->Host = "smtp.live.com";
$mail->Port = "587";
$mail->From = $yollayan;
$mail->Fromname = $name;
$mail->name = $name;
$mail->Subject = $subject;
$mail->Body = $message;
$mail->AddAddress($val);
$mail->send();
}
class MyPHPMailer extends PHPMailer {
public $DbgOut = '';
private function edebug($str) {
$this->DbgOut .= $str;
}
}
function mailsender($val, $yollayan, $sifresi, $name, $subject, $message) {
$mail = new MyPHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug = 1;
$mail->SMTPAuth = true;
$mail->SMTPSecure = "tls";
$mail->Username = $yollayan;
$mail->Password = $sifresi;
$mail->Host = "smtp.live.com";
$mail->Port = "587";
$mail->From = $yollayan;
$mail->Fromname = $name;
$mail->name = $name;
$mail->Subject = $subject;
$mail->Body = $message;
$mail->AddAddress($val);
$mail->send();
if(strlen($mail->DbgOut) > 10)
echo 'Failed'.PHP_EOL;
}