Makes 'To' optional, like 'Cc' and 'Bcc'. An exception is still thrown if there are no recipients at all (see bug #2912670).
This commit is contained in:
parent
7a6dcdf385
commit
45faafdced
@ -54,10 +54,16 @@ ref <message> messageBuilder::construct() const
|
||||
if (m_from.isEmpty())
|
||||
throw exceptions::no_expeditor();
|
||||
|
||||
if (m_to.isEmpty() || m_to.getAddressAt(0)->isEmpty())
|
||||
if ((m_to.isEmpty() || m_to.getAddressAt(0)->isEmpty()) &&
|
||||
(m_cc.isEmpty() || m_cc.getAddressAt(0)->isEmpty()) &&
|
||||
(m_bcc.isEmpty() || m_bcc.getAddressAt(0)->isEmpty()))
|
||||
{
|
||||
throw exceptions::no_recipient();
|
||||
}
|
||||
|
||||
msg->getHeader()->From()->setValue(m_from);
|
||||
|
||||
if (!m_to.isEmpty())
|
||||
msg->getHeader()->To()->setValue(m_to);
|
||||
|
||||
if (!m_cc.isEmpty())
|
||||
|
Loading…
Reference in New Issue
Block a user