Vergleich inc/class_mailhandler.php - 1.8.0 - 1.8.26

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 33Zeile 33
	 * @var string
*/
public $from;

	 * @var string
*/
public $from;

 

/**
* Full from string including name in format "name" <email>
*
* @var string
*/
public $from_named;


/**
* Who the email should return to.


/**
* Who the email should return to.

Zeile 43Zeile 50

/**
* The subject of mail.


/**
* The subject of mail.

	 *
* @var string

	 *
* @var string

	 */
public $subject;


	 */
public $subject;


Zeile 61Zeile 68
	 * @var string
*/
public $message;

	 * @var string
*/
public $message;


/**


/**

	 * The headers of the mail.
*
* @var string

	 * The headers of the mail.
*
* @var string

Zeile 71Zeile 78

/**
* The charset of the mail.


/**
* The charset of the mail.

	 *

	 *

	 * @var string
* @default utf-8

	 * @var string
* @default utf-8

	 */

	 */

	public $charset = "utf-8";

/**
* The currently used delimiter new lines.

	public $charset = "utf-8";

/**
* The currently used delimiter new lines.

	 *
* @var string.
*/

	 *
* @var string
*/

	public $delimiter = "\r\n";

	public $delimiter = "\r\n";


/**


/**

	 * How it should parse the email (HTML or plain text?)
*

	 * How it should parse the email (HTML or plain text?)
*

	 * @var array






















	 * @var string
*/
public $parse_format = 'text';

/**
* The last received response from the SMTP server.
*
* @var string
*/
public $data = '';

/**
* The last received response code from the SMTP server.
*
* @var string
*/
public $code = 0;

/**
* Selects between AdminEmail and ReturnEmail, dependant on if ReturnEmail is filled.
*
* @return string

	 */

	 */

	public $parse_format = 'text';















	function get_from_email()
{
global $mybb;

if(trim($mybb->settings['returnemail']))
{
$email = $mybb->settings['returnemail'];
}
else
{
$email = $mybb->settings['adminemail'];
}

return $email;
}


/**
* Builds the whole mail.
* To be used by the different email classes later.
*


/**
* Builds the whole mail.
* To be used by the different email classes later.
*

	 * @param string to email.
* @param string subject of email.
* @param string message of email.
* @param string from email.
* @param string charset of email.
* @param string headers of email.
* @param string format of the email (HTML, plain text, or both?).
* @param string plain text version of the email.
* @param string the return email address.

	 * @param string $to to email.
* @param string $subject subject of email.
* @param string $message message of email.
* @param string $from from email.
* @param string $charset charset of email.
* @param string $headers headers of email.
* @param string $format format of the email (HTML, plain text, or both?).
* @param string $message_text plain text version of the email.
* @param string $return_email the return email address.

	 */
function build_message($to, $subject, $message, $from="", $charset="", $headers="", $format="text", $message_text="", $return_email="")
{

	 */
function build_message($to, $subject, $message, $from="", $charset="", $headers="", $format="text", $message_text="", $return_email="")
{

Zeile 111Zeile 153

$this->message = '';
$this->headers = $headers;


$this->message = '';
$this->headers = $headers;



		

		if($from)

		if($from)

		{

		{

			$this->from = $from;

			$this->from = $from;

 
			$this->from_named = $this->from;

		}
else
{

		}
else
{

			$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->from = $this->get_from_email();
$this->from_named = '"'.$this->utf8_encode($mybb->settings['bbname']).'"';
$this->from_named .= " <".$this->from.">";









		}

if($return_email)

		}

if($return_email)

Zeile 137Zeile 172
		}
else
{

		}
else
{

			$this->return_email = "";
if($mybb->settings['returnemail'])
{
$this->return_email = $mybb->settings['returnemail'];
}
else
{
$this->return_email = $mybb->settings['adminemail'];
}

			$this->return_email = $this->get_from_email();









		}

$this->set_to($to);

		}

$this->set_to($to);

Zeile 164Zeile 191
	/**
* Sets the charset.
*

	/**
* Sets the charset.
*

	 * @param string charset

	 * @param string $charset charset

	 */
function set_charset($charset)
{

	 */
function set_charset($charset)
{

Zeile 183Zeile 210
	/**
* Sets and formats the email message.
*

	/**
* Sets and formats the email message.
*

	 * @param string message


	 * @param string $message message
* @param string $message_text

	 */
function set_message($message, $message_text="")
{

	 */
function set_message($message, $message_text="")
{

Zeile 208Zeile 236
	/**
* Sets and formats the email subject.
*

	/**
* Sets and formats the email subject.
*

	 * @param string subject

	 * @param string $subject

	 */
function set_subject($subject)
{

	 */
function set_subject($subject)
{

Zeile 219Zeile 247
	/**
* Sets and formats the recipient address.
*

	/**
* Sets and formats the recipient address.
*

	 * @param string to

	 * @param string $to

	 */
function set_to($to)
{

	 */
function set_to($to)
{

Zeile 239Zeile 267
	/**
* Sets the alternative headers, text/html and text/plain.
*

	/**
* Sets the alternative headers, text/html and text/plain.
*

	 * @param string message


	 * @param string $message
* @param string $message_text

	 */
function set_html_headers($message, $message_text="")
{

	 */
function set_html_headers($message, $message_text="")
{

Zeile 284Zeile 313
		global $mybb;

// Build mail headers

		global $mybb;

// Build mail headers

		$this->headers .= "From: {$this->from}{$this->delimiter}";

		$this->headers .= "From: {$this->from_named}{$this->delimiter}";


if($this->return_email)
{


if($this->return_email)
{

Zeile 320Zeile 349
	/**
* Log a fatal error message to the database.
*

	/**
* Log a fatal error message to the database.
*

	 * @param string The error message
* @param string Any additional information

	 * @param string $error The error message


	 */
function fatal_error($error)
{

	 */
function fatal_error($error)
{

Zeile 345Zeile 373
	/**
* Rids pesky characters from subjects, recipients, from addresses etc (prevents mail injection too)
*

	/**
* Rids pesky characters from subjects, recipients, from addresses etc (prevents mail injection too)
*

	 * @param string The string being checked

	 * @param string $string The string being checked

	 * @return string The cleaned string
*/
function cleanup($string)

	 * @return string The cleaned string
*/
function cleanup($string)

Zeile 359Zeile 387
	 * Converts message text to suit the correct delimiter
* See dev.mybb.com/issues/1735 (Jorge Oliveira)
*

	 * Converts message text to suit the correct delimiter
* See dev.mybb.com/issues/1735 (Jorge Oliveira)
*

	 * @param string The text being converted

	 * @param string $text The text being converted

	 * @return string The converted string
*/
function cleanup_crlf($text)

	 * @return string The converted string
*/
function cleanup_crlf($text)

Zeile 376Zeile 404
	 * and recipients in email messages going out so that they show up correctly
* in email clients.
*

	 * and recipients in email messages going out so that they show up correctly
* in email clients.
*

	 * @param string The string to be encoded.

	 * @param string $string The string to be encoded.

	 * @return string The encoded string.
*/
function utf8_encode($string)

	 * @return string The encoded string.
*/
function utf8_encode($string)