MyBB Community Forums

Full Version: User Activation email not sent, other email ok
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I'm searching for an answer to this problem;
I noticed that I wasn't getting emails from the site, sendmail is OK on my server, my website uses it with no problems. I modded the php.php with code suggested from another thread and can now send user to user emails but a fake user I created is still waiting to be activated but the email won't come through????
Any ideas?
So you're sure registration is set to email activation, and you've checked the spam folder?? What file edits did you make??
I've just checked the activation method and it is via email, there's nothing in the spam either. i also ran the test script suggested in the wiki and that was ok, the email address is my work one, I'll try setting up a new user with another email address incase its something to do with my company email server.
The inc>mailhandlers>php.php was changed from the default to this;
<?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 4181 2008-09-07 17:19:49Z Tikitiki $
 */

// 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['kitchenfoods.co.uk'])
		{
			@ini_set("sendmail_from", $mybb->settings['kitchenfoods.co.uk']);
		}

		// 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);
		}
		else
		{
			$sent = @mail($this->to, $this->subject, $this->message);
		}
		$function_used = 'mail()';

		if(!$sent)
		{
			$this->fatal_error("MyBB was unable to send the email using the PHP {$function_used} function.");
			return false;
		}

		return true;
	}
}
Just put that in PHP tags for you.

Can we have a URL to your forum?? I'll see if they send for me. If not, download a copy of your modified file, upload the default one, and I'll try it again.
How did you put it in php tags??
I've just tried registering a new user to another email address and that didn't work. The only other mod I have made is removing the log in boxes from the welcomeguest template to resolve the password conflict. the forum is here; www.kitchenfoods.co.uk
sorry the link should be www.kitchenfoods.co.uk/forum
I have the original php.php ready to upload back to the server if need be.
Quote the post and see Toungue

Ok, I just registered, and got the email... if it isn't in the spam folder, check that the address isn't on a block list for your account. Recently I realised I wasn't getting emails from a site for that reason.