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,11 +54,17 @@ ref <message> messageBuilder::construct() const
|
|||||||
if (m_from.isEmpty())
|
if (m_from.isEmpty())
|
||||||
throw exceptions::no_expeditor();
|
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();
|
throw exceptions::no_recipient();
|
||||||
|
}
|
||||||
|
|
||||||
msg->getHeader()->From()->setValue(m_from);
|
msg->getHeader()->From()->setValue(m_from);
|
||||||
msg->getHeader()->To()->setValue(m_to);
|
|
||||||
|
if (!m_to.isEmpty())
|
||||||
|
msg->getHeader()->To()->setValue(m_to);
|
||||||
|
|
||||||
if (!m_cc.isEmpty())
|
if (!m_cc.isEmpty())
|
||||||
msg->getHeader()->Cc()->setValue(m_cc);
|
msg->getHeader()->Cc()->setValue(m_cc);
|
||||||
|
Loading…
Reference in New Issue
Block a user