Reputation: 55
I am sending a batch mail and I want to send a copy (bcc) to an admin mail group. Is it possible to send mail to a bcc receipent in AX 2009?
Thanks in advance.
Upvotes: 1
Views: 2300
Reputation: 421
I'm not sure about AX 2009, but in AX 2012 you can reuse methods tos()
and ccs()
and create new ones (tosBccs()
and bccs()
) like so:
SysMailerAddressField tosBCC()
{
;
return SysMailerAddressField::create(_com, SysmailerAddressFieldType::Bcc);
}
SysMailerAddressField bccs()
{
InteropPermission permission = new InteropPermission(InteropKind::ComInterop);
permission.assert();
//BP Deviation Documented
return SysMailerAddressField::create(_com,SysmailerAddressFieldType::Bcc);
}
Now, in your email code, where you use SysMailer
object you can call above functionality:
SMTPUserName _bccAddress;
;
if(_bccAddress != "")
{
mailer.tosBCC().appendAddress(_bccAddress);
}
Here you can find a full example (you may need to use Google Translate though). I'm pretty sure that should work in AX 2009 too.
Upvotes: 1