10-23-2007, 01:13 PM
Hello Everybody,
I use MyBB since yesterday and I found out that my Static IP will be blocked from several Mailservers. Now I rewrite the Mail Function in ('inc/functions.php') and edited the my_mail() function.
all you need is to get the phpmailer Class from here and replace the function in functions.php with the following code
now you are ready to sent emails undependent on your Webserver!
best regardes
troniac[/code]
I use MyBB since yesterday and I found out that my Static IP will be blocked from several Mailservers. Now I rewrite the Mail Function in ('inc/functions.php') and edited the my_mail() function.
all you need is to get the phpmailer Class from here and replace the function in functions.php with the following code
PHP Code:
function my_mail($to, $subject, $message, $from="", $charset="", $headers="")
{
require("class.phpmailer.php");
$mail = new PHPMailer();
global $db, $mybb, $lang;
if(empty($charset))
{
$charset = $lang->settings['charset'];
}
// Build e-mail
$mail->From = "foo@bar.com"; // here comes your email address in
$mail->FromName = $mybb->settings['bbname'];
$mail->Host = "smtp.example.com"; // your SMTP Server
$mail->Mailer = "smtp"; // SMTP Method
$mail->SMTPAuth = true; // Auth Type
$mail->Username = "your username";
$mail->Password = "your password";
$mail->AddAddress($to, "");
$mail->Subject = $subject;
$mail->Body = $message;
if(!$mail->Send())
echo "There has been a mail error sending to ".$to." with Error: ".$mail->ErrorInfo;
$mail->ClearAddresses();
}
now you are ready to sent emails undependent on your Webserver!
best regardes
troniac[/code]


