MyBB Community Forums

Full Version: Activation Email Not Sending
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello

I found one other thread on this problem and I cannot understand the response, so I'm posting here in hopes someone can help me.

I am getting the following errors when I try top test sending out an activation email.

If I use the PHP mail setting I get:
MyBB was unable to send the email using the PHP mail() function.

If I use the SMTP setting, with all the information filled in correctly, I get:

The SMTP server does not support any of the AUTH methods that MyBB supports

and

The mail server does not understand the RCPT TO command. Reason: 530 SMTP authentication is required.

I don't know if there is something I need to do on my web site or in mybb?

Can anyone help me?

Thanks
Both of these are things you'll need to ask your host about. Try this test: [Wiki: Help:Mail] (Broken link, head over to docs.mybb.com instead) If that fails there's nothing we can do.
Hi. I tried the test and it worked. I set mail to php but I get errors.

I have since made changes to the php.php file from a document that has been circulated here and I get an error:

Fatal error: require_once() [function.require]: Failed opening required 'Mail.php' (include_path='C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\pear;./;./includes;./pear') in E:\inetpub\vhosts\lovingmatches.com\httpdocs\forums\inc\mailhandlers\php.php on line 57

Does this error mean that PEAR is not installed, because I cannot find the Mail.php file that is called from the php.php file, after the changes were made. My host said that PEAR has been installed on the server.

This is driving me crazy.

Here's what my php.php file looks like (obviously I've changed the server acct info):

<?php
/**
* MyBB 1.4
* Copyright © 2008 MyBB Group, All Rights Reserved
*
* Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*
* $Id: php.php 4304 2009-01-02 01:11:56Z chris $
*/

// Disallow direct access to this file for security reasons
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}

/**
* PHP mail handler class.
*/
class PhpMail extends MailHandler
{
/**
* Additional parameters to pass to PHPs mail() function.
*
* @var string
*/
var $additional_parameters = '';

/**
* Sends the email.
*
* @return true/false whether or not the email got sent or not.
*/
function send() {
global $lang, $mybb;

// For some reason sendmail/qmail doesn't like \r\n
$this->sendmail = @ini_get('sendmail_path');
if($this->sendmail) {
$this->headers = str_replace("\r\n", "\n", $this->headers);
$this->message = str_replace("\r\n", "\n", $this->message);
$this->delimiter = "\n";
}

// Some mail providers ignore email's with incorrect return-to path's so try and fix that here
$this->sendmail_from = @ini_get('sendmail_from');
if($this->sendmail_from != $mybb->settings['adminemail']) {
@ini_set("sendmail_from", $mybb->settings['adminemail']);
}

// If safe mode is on, don't send the additional parameters as we're not allowed to
if(ini_get('safe_mode') == 1 || strtolower(ini_get('safe_mode')) == 'on') {
$sent = @mail($this->to, $this->subject, $this->message, trim($this->headers));
}
else {
require_once "Mail.php";

$from = $this->from;
$to = $this->to;
$subject =$this->subject;
$body = $this->message;

$host = "mail.mydomain.com";
$username = "[email protected]";
$password = "mypassword";

$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));

$mail = $smtp->send($to, $headers, $body);

if (PEAR::isError($mail)) {
$this->fatal_error("MyBB was unable to send the email using the PHP authentication function function.");
}

}

return true;
}
}
?>
Don't know where you've got that from as that's not the default version of that file...
I'm sorry, Matt, but the default version isn't working for me. That's why I'm here. This is a problem for a lot of people.

There's a document that's been in several threads here about this issue. It says that you have to make these changes, because the original file doesn't work for many web host sites.

Otherwise, the test file you proposed works. It sends out the email, but the activation code email in the mybb software does not work. I keep getting the error I posted.

Here's a thread that shows the link to the file to make this work. bjoris, the one who posted it, said he got his site to work by changing the file. My problem is I get the error I posted because it doesn't see a Mail.php file, that is a part of PEAR.

http://community.mybboard.net/thread-571...#pid495593
So you sent and received that PHP mail test from that wiki page without any problems or errors?
Yes, I ran the page and the email showed up in my inbox.
Ok, can you upload a fresh copy of ./inc/mailhandlers/mail.php and tell us what errors you get when trying to send mail.
Sorry, Tim, but I've been saying that I don't have a mail.php file. My host has assured me that PEAR has been installed, but there is no Mail.php file in the mailhandlers folder.
Oops, sorry, my mistake I was getting confused. I mean php.php in the ./inc/mailhandlers/ folder and also ./inc/class_mailhandler.php, replace both of those with fresh copies.
Pages: 1 2