Felix
Felix

Reputation: 5619

Typ3 Send Mail function

I'm trying to send Mails from my typo3 site.

Im Using the MailMessage() function

// Verschicken der Nachricht
    $message = (new \TYPO3\CMS\Core\Mail\MailMessage())
            ->setFrom(array('[email protected]' => 'Result Repository'))
            ->setTo(array($empfaenger => $name))
            ->setSubject("Ihr Result Repository Nutzer.")
            ->setBody('<html><head></head><body><p>Hallo ' . $name . ' ' . $vorname . ', für Sie wurde ein Nutzer für das Result Repository angelegt.</p><br><br> <b>Username:</b> ' . $username . '<br> <b>Passwort:</b> ' . $passwort . '</body></html>', 'text/html');
    $message->send();

Normaly this works fine. But I have the problem that I receive Mails on my account. And Some others especially Gmail receive the Mail also.

But some Others for example GMX don't receive the mail and They have checked the Spam folder as well.

how can I solve this issue?

Upvotes: 0

Views: 777

Answers (1)

derhansen
derhansen

Reputation: 6133

To find the reason, why e-mails sent from TYPO3 don't reach the intended recipient, you have to check the webservers maillog. There you may find a message from the receiving SMTP server, why the e-mail message sent from TYPO3 has not been rejected. Sometimes, e-mails sent from TYPO3 from a "faked" or non existens e-mail-adress are being rejected by remote e-mail-servers, because the remote servers spam protection. The remote e-mail server may e.g. use Greylisting, DNS blacklists, validate SPF records or validate the sending domain/e-mail address. Depending on the remote e-mail-servers setup (e.g. SPF validation fails), the server may even reject your e-mail completely, so it does not appear the spam folder of the e-mail recpient.

To avoid problems with remote e-mail-servers blocking e-mail sent from TYPO3, I would recommend to configure TYPO3 to send e-mails by using a SMTP account for the domain you are sending from.

Upvotes: 1

Related Questions