2 namespace TYPO3\CMS\Core\Utility;
31 $address = self::getSystemFromAddress();
32 $name = self::getSystemFromName();
36 return array($address => $name);
38 return array($address);
51 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'MAIL'][
'defaultMailFromName']) {
52 return $GLOBALS[
'TYPO3_CONF_VARS'][
'MAIL'][
'defaultMailFromName'];
74 $address =
$GLOBALS[
'TYPO3_CONF_VARS'][
'MAIL'][
'defaultMailFromAddress'];
78 $domainRecord =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetSingleRow(
'domainName',
'sys_domain',
'hidden = 0',
'',
'pid ASC, sorting ASC');
79 if (!empty($domainRecord[
'domainName'])) {
80 $tempUrl = $domainRecord[
'domainName'];
84 $tempUrl =
'http://' . $tempUrl;
86 $host = parse_url($tempUrl, PHP_URL_HOST);
88 $address =
'no-reply@' . $host;
91 $address =
'no-reply@' . php_uname(
'n');
94 $address =
'no-reply@example.com';
114 while (strlen($str) > $substrStart) {
115 $substr = substr($str, $substrStart, $lineWidth);
117 if (strlen($substr) == $lineWidth) {
119 $spacePos = strrpos(rtrim($substr),
' ');
121 if ($spacePos !==
false) {
123 $theLine = substr($substr, 0, $spacePos);
128 $afterParts = explode(
' ', substr($str, $lineWidth + $substrStart), 2);
129 $theLine = $substr . $afterParts[0];
131 if ($theLine ===
'') {
138 $lines[] = trim($theLine);
139 $substrStart += strlen($theLine);
140 if (trim(substr($str, $substrStart, $lineWidth)) ===
'') {
145 return implode($newlineChar, $lines);
160 public static function parseAddresses($rawAddresses)
164 \TYPO3\CMS\Core\Mail\Rfc822AddressesParser::class,
167 $addresses = $addressParser->parseAddressList();
168 $addressList = array();
169 foreach ($addresses as $address) {
170 if ($address->mailbox ===
'') {
173 if ($address->personal) {
175 $addressList[$address->mailbox .
'@' . $address->host] = $address->personal;
178 $addressList[] = $address->mailbox .
'@' . $address->host;