40 return [$address => $name];
54 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'MAIL'][
'defaultMailFromName']) {
55 return $GLOBALS[
'TYPO3_CONF_VARS'][
'MAIL'][
'defaultMailFromName'];
76 $address =
$GLOBALS[
'TYPO3_CONF_VARS'][
'MAIL'][
'defaultMailFromAddress'];
77 if (!GeneralUtility::validEmail($address)) {
80 $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
81 ->getQueryBuilderForTable(
'sys_domain');
83 $queryBuilder->getRestrictions()
85 ->add(GeneralUtility::makeInstance(HiddenRestriction::class));
87 $domainRecord = $queryBuilder
88 ->select(
'domainName')
90 ->orderBy(
'pid',
'ASC')
91 ->orderBy(
'sorting',
'ASC')
95 if (!empty($domainRecord[
'domainName'])) {
96 $tempUrl = $domainRecord[
'domainName'];
97 if (!GeneralUtility::isFirstPartOfStr($tempUrl,
'http')) {
100 $tempUrl =
'http://' . $tempUrl;
102 $host = parse_url($tempUrl, PHP_URL_HOST);
104 $address =
'no-reply@' . $host;
105 if (!GeneralUtility::validEmail($address)) {
107 $address =
'no-reply@' . php_uname(
'n');
108 if (!GeneralUtility::validEmail($address)) {
110 $address =
'no-reply@example.com';
126 $mailConfiguration =
$GLOBALS[
'TYPO3_CONF_VARS'][
'MAIL'];
127 $replyToAddress = $mailConfiguration[
'defaultMailReplyToAddress'];
128 if (empty($replyToAddress) || !GeneralUtility::validEmail($replyToAddress)) {
132 if (!empty($mailConfiguration[
'defaultMailReplyToName'])) {
133 $replyTo = [$replyToAddress => $mailConfiguration[
'defaultMailReplyToName']];
135 $replyTo = [$replyToAddress];
154 while (strlen($str) > $substrStart) {
155 $substr = substr($str, $substrStart, $lineWidth);
157 if (strlen($substr) == $lineWidth) {
159 $spacePos = strrpos(rtrim($substr),
' ');
161 if ($spacePos !==
false) {
163 $theLine = substr($substr, 0, $spacePos);
168 $afterParts = explode(
' ', substr($str, $lineWidth + $substrStart), 2);
169 $theLine = $substr . $afterParts[0];
171 if ($theLine ===
'') {
178 $lines[] = trim($theLine);
179 $substrStart += strlen($theLine);
180 if (trim(substr($str, $substrStart, $lineWidth)) ===
'') {
185 return implode($newlineChar, $lines);
203 $addressParser = GeneralUtility::makeInstance(
204 \
TYPO3\CMS\Core\Mail\Rfc822AddressesParser::class,
207 $addresses = $addressParser->parseAddressList();
209 foreach ($addresses as $address) {
210 if ($address->mailbox ===
'') {
213 if ($address->personal) {
215 $addressList[$address->mailbox .
'@' . $address->host] = $address->personal;
218 $addressList[] = $address->mailbox .
'@' . $address->host;