MyBB Community Forums

Full Version: How to edit 'From: "name"' for 'Mass Mail' ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Would like to edit "name" to something other than 'Board Name' for 'Mass Mail'.
If possible, where should look for settings etc ?
Couldnt find answer in 'search' or 'wiki - Admin CP Mass Mail' unless missed something.
:unsure: you may have to login to admin panel with a different account (that user name is used) ...
(2011-09-29, 07:19 PM)ranjani Wrote: [ -> ]:unsure: you may have to login to admin panel with a different account (that user name is used) ...
Thank you for the reply.
Sorry, should have shown example, the 'from' address for the 'mass mailing' looks like this...
"front page name etc" <[email protected]>
...would like to change the "front page name etc" to something else.
Assume that does not relate to the ACP login ?


(2011-09-29, 07:44 PM)akm Wrote: [ -> ]Thank you for the reply.
Sorry, should have shown example, the 'from' address for the 'mass mailing' looks like this...
"front page name etc" <[email protected]>
...would like to change the "front page name etc" to something else.
Assume that does not relate to the ACP login ?

Seem to have found the file for mass mailing 'From:' info, inc/class_mailhandler.php, and the related code...

function set_common_headers()
{
global $mybb;
// Build mail headers
if(!trim($this->from))
{
if($mybb->settings['mail_handler'] == 'smtp')
{
$this->from = $mybb->settings['adminemail'];
}
else
{
$this->from = '"'.$this->utf8_encode($mybb->settings['bbname']).'"';
$this->from .= " <{$mybb->settings['adminemail']}>";
}
}
$this->headers .= "From: {$this->from}{$this->delimiter}";

Also, 'ranjani' helped with code for edit the last line to change the "name', and that worked fine.

But, also just noticed the 'From:' email address displayed is the " bbname " @subservername. servername.com , instead of [email protected], which is the address used if the email is replied to.

Missed that before, hope ok to add to this question.

So, how to edit the mass mailing 'From:' email address display so it shows the actual return email address, along with the edited "name", or no " name" ?

Sorry not that familiar with php code, so still trying to learn.
Any help would be appreciated.
Thank you.
No answers yet, just wondering it any new info may be available ?
^ not sure what is your exact requirement. see if this thread has any clue
Thank you for the reply/info !
I checked the 'this thread' link, and it seems close, but the code in my class_mailhandler.php file seems somewhat different at the following part...

The link shows...
// Build mail headers
  $this->headers .= "From: {$mybb->settings['bbname']} <{$this->from}>{$this->delimiter}";

While in my file it is shown as...
// Build mail headers
  $this->headers .= "From: {$this->from}{$this->delimiter}";

Would like to show a custom name in the From: header like...
From: "custom name" <webmaster@domainname>

instead of...
From: "board name" <webmaster@domainname>

The complete 'headers' code section from my class_mailhandler.php file is below.
Hope that helps clarify the question.
Thanks again.


/**
	 * Sets the common headers.
	 */
	function set_common_headers()
	{
		// Build mail headers
		$this->headers .= "From: {$this->from}{$this->delimiter}";
		
		if($this->return_email)
		{
			$this->headers .= "Return-Path: {$this->return_email}{$this->delimiter}";
			$this->headers .= "Reply-To: {$this->return_email}{$this->delimiter}";
		}

		if(isset($_SERVER['SERVER_NAME']))
		{
			$http_host = $_SERVER['SERVER_NAME'];
		}
		else if(isset($_SERVER['HTTP_HOST']))
		{
			$http_host = $_SERVER['HTTP_HOST'];
		}
		else
		{
			$http_host = "unknown.local";
		}

		$msg_id = md5(uniqid(TIME_NOW)) . "@" . $http_host;

		if($mybb->settings['mail_message_id'])
		{
			$this->headers .= "Message-ID: <{$msg_id}>{$this->delimiter}";
		}
		$this->headers .= "Content-Transfer-Encoding: 8bit{$this->delimiter}";
		$this->headers .= "X-Priority: 3{$this->delimiter}";
		$this->headers .= "X-Mailer: MyBB{$this->delimiter}";
		$this->headers .= "MIME-Version: 1.0{$this->delimiter}";
	}


(2015-02-06, 03:56 AM).m. Wrote: [ -> ]^ not sure what is your exact requirement. see if this thread has any clue
Some T&E got this to work for now, at least a work-a-round if nothing else...
 Confused

else
			{	

/** change omit below */
			
/**				
			$this->from = '"'.$this->utf8_encode($mybb->settings['bbname']).'"';
*/			

/** change below from
$this->from .= "<{$mybb->settings['adminemail']}>";
to */

			$this->from .= "revised bb name <{$mybb->settings['adminemail']}>";
			
			}

And thanks to all for the leads to class_mailhandler.php etc.