MyBB Community Forums

Full Version: Doesn't support mail; now what?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
It turns out I can't use PHP Mail on my host.
Quote:Regular PHP mail functions may not be used with our mail servers as we have SMTP authentication enabled. Use the code below with the phpMailer to send e-mails. The username and password will need to be replaced with your e-mail username and password.

Here is the code listed. I don't understand at all, but maybe you guys can tell me if this can be used with myBB at all.

<?php
require("class.phpmailer.php");

$mail = new PHPMailer();

$mail->IsSMTP();                                      // set mailer to use SMTP
$mail->Host = "mail.reliablesite.net";                // specify server
$mail->SMTPAuth = true;     // turn on SMTP authentication
$mail->Username = "emaillogin";  // SMTP username
$mail->Password = "emailpassword"; // SMTP password

$mail->From = "[email protected]";
$mail->FromName = "My Name";
$mail->AddAddress("[email protected]");
$mail->AddReplyTo("[email protected]", "My Name");

$mail->WordWrap = 50;                                 // set word wrap to 50 characters
$mail->IsHTML(true);                                  // set email format to HTML

$mail->Subject = "Here is the subject";
$mail->Body    = "This is the HTML message body <b>in bold!</b>";
$mail->AltBody = "This is the body in plain text for non-HTML mail clients";

if(!$mail->Send())
{
   echo "Message could not be sent. <p>";
   echo "Mailer Error: " . $mail->ErrorInfo;
   exit;
}

echo "Message has been sent";
?>
MyBB 1.2 does not have built in support for SMTP mail, MyBB 1.4 however will do.

If someone knows how to mod MyBB 1.2 to work with SMTP, feel free to say Toungue (I'm off to bed now, got to be up again in 4 hours)
I find it weird that my PAID host has disabled such a basic function.

If there is any way to do it, I'd really like to know; I need this forum up soon.

EDIT: I found this in my search: http://community.mybboard.net/showthread.php?tid=13687

I don't really understand. Is there a way to edit functions.php so I can use mail?
Quote:Hello,

Unlike many paid hosts, we are very strict with our mail servers and have never had them black listed. You aren't out of luck, you can replace the mail function that your board uses with the code provided in the knowledge base article. If you need assistance with this we can have one of our programmers take a look and make a few changes for you.

OK. I don't really feel like waiting around for them. Can anyone show me where to stick this code?
I would leave the host.

Which host is it?
http://www.reliablesite.net

They've been great to me except for this. I understand their reasoning, it's just a security thing.
That's BS. It's not a security threat. Especially if your paying, I would leave. There are tons of other hosts out there that are cheap and are better than they are.
They modified the code for it to work. Thanks for your help. Smile
Hello,

Just as a correction, all of our servers do have the mail function enabled, but our servers use SMTP Authentication which the standard php mail function does not support. Therefor as an alternative we ask that our customers use the phpMailer class instead.

95% of PHP scripts have support for SMTP Authentication due to the increased protection against spamming and such. For example, if a script get's compromised and then used to send out mass e-mail using the standard php mail function, this would cause the mail servers to get black listed.

Either way our programmers have automatically changed the code and everything is confirmed working, and we are providing the recoding service free of charge to any of our customers as part of our standard support. If you have any other questions regarding php mail, I would be more than glad to answer them.

EDIT:
I have also posted a quick how-to in the code modification section for those of you that need to have SMTP authentication enabled.

Thanks.
Tikitiki Wrote:It's not a security threat.

A security threat qualifies as anything that can be exploitable. The PHP mail function is incredibly easy to exploit when a script has been compromised causing service deterioration to the rest of our customers. How mad would it make you to find out that someone else's script caused the mail server to not send out e-mails or even cause all the e-mails to be labeled as junk mail because the servers were blacklisted? SMTP Authentication adds an extra layer of protection, but at times makes things a little tougher for our customers as well. We offer our developer services free of charge to a reasonable extent to assist with any recoding required to meet the needs. Quality of service and support is the difference, something that can't be found in the same region of "cheap".

I'm in no way trying to offend anyone here, just trying to show our side of the matter and why we chose to do what we do.

Thanks
Pages: 1 2