Set Joomla instance to use PHP Mail or Sendmail.
Perform some activity that causes email to be sent (registration, contact).
Generated email is sent without issue
Error: Could not instantiate mail function.
Joomla 4 or 5 on Siteground hosting
Some systems fail when attempting to send email which has the recipient name and email set to the same value (501 error).
libraries/src/Mail/MailTemplate.php
* @since 4.0.0
*/
public function addRecipient($mail, $name = null, $type = 'to')
{
$recipient = new \stdClass();
$recipient->mail = $mail;
$recipient->name = $name ?? $mail; <<<<====
$recipient->type = $type;
$this->recipients[] = $recipient;
}
addRecipient() is often called with only an email address, which causes the name to be set to the same as email.
This is causing failure on some servers (or their mail servers).
$recipient->name = $name ?? strstr($mail,'@',true);
All Joomla calls to this addRecipient() method provide an appropriate name argument.
Labels |
Added:
No Code Attached Yet
|
Labels |
Added:
bug
|
It is kind of server protection from users who trying to send spam.
I think Joomla should not try to set a name if it not provided, it is totally fine to have only an email.