I'm trying to, when an email is sent within my Symfony2 application, to name the sender
Administrator <[email protected]>
I've tried in the parameters.ini
:
mailer_from = {"[email protected] : Administrator"}
It seems possible to do so because in SimpleMessage.php we do have :
/**
* Set the sender of this message.
* This does not override the From field, but it has a higher significance.
* @param string $sender
* @param string $name optional
* @return Swift_Mime_SimpleMessage
*/
public function setSender($address, $name = null)
{
if (!is_array($address) && isset($name))
{
$address = array($address => $name);
}
if (!$this->_setHeaderFieldModel('Sender', (array) $address))
{
$this->getHeaders()->addMailboxHeader('Sender', (array) $address);
}
return $this;
}
All the things I tried in the parameters.ini
failed. Do you have any idea of what i'm doing wrong please ?
Add a contact from an email message Open the message so that the person's name is shown in one of these lines: From:, To:, Cc:, or Bcc:. Right-click the appropriate name, choose Add to Outlook Contacts. In the window that opens, fill in the details you want to save.
The display name is the name that appears on your outgoing emails. This is the name recipients will see when you email them.
// Set a single From: address
$message->setFrom('[email protected]');
// Set a From: address including a name
$message->setFrom(array('[email protected]' => 'Your Name'));
// Set multiple From: addresses if multiple people wrote the email
$message->setFrom(array(
'[email protected]' => 'Sender One',
'[email protected]' => 'Sender Two'
));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With