02-24-2012, 05:09 PM
download PHPMailer from http://code.google.com/a/apache-extras.o...loads/list and add a folder called PHPMailer in the docRootOfLetoDMS
I changed file inc/inc.ClassEmail.php
add after line 19
in the class I added
lines likechanged to
have fun
rainer
I changed file inc/inc.ClassEmail.php
add after line 19
PHP Code:
require_once('../PHPMailer/class.phpmailer.php');
in the class I added
PHP Code:
function mail($recipient, $subject, $message, $header){
$recList = split(',', $recipient);
$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
$mail->IsSMTP(); // telling the class to use SMTP
try {
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->Username = "rainer@example.com"; // GMAIL username
$mail->Password = "password"; // GMAIL password
$mail->AddReplyTo('barbara@example.net', 'ReplyToMe');
foreach ($recList as $value) {
$mail->AddAddress($value, $value);
}
$mail->SetFrom('barbara@example.net', 'myDMS');
$mail->Subject = $subject;
$mail->Body = $message;
$mail->Send();
} catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}
}
lines like
PHP Code:
return (mail($recipient->getEmail(), $this->replaceMarker($subject), $this->replaceMarker($message), $header) ? 0 : -1);
PHP Code:
return ($this->mail($recipient->getEmail(), $this->replaceMarker($subject), $this->replaceMarker($message), $header) ? 0 : -1);
have fun
rainer