本文整理汇总了C++中zimbra::util::ScopedInterface::put_EmailAddress方法的典型用法代码示例。如果您正苦于以下问题:C++ ScopedInterface::put_EmailAddress方法的具体用法?C++ ScopedInterface::put_EmailAddress怎么用?C++ ScopedInterface::put_EmailAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类zimbra::util::ScopedInterface
的用法示例。
在下文中一共展示了ScopedInterface::put_EmailAddress方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateExchangeMailBox
//.........这里部分代码省略.........
if (FAILED(hr = pIADNewUser->Put(CComBSTR("legacyExchangeDN"), varProp)))
throw ExchangeAdminException(hr, L"CreateExchangeMailBox(): Put(legacyExchangeDN) Failed.",
ERR_CREATE_EXCHMBX, __LINE__, __FILE__);
}
if(FAILED(hr = pIADNewUser->SetInfo()))
ThrowSetInfoException(hr, L"SetInfo - Put(legacyExchangeDN) Failed.");
// set nickname
varProp.Clear();
varProp = lpwstrNewUser;
if (FAILED(hr = pIADNewUser->Put(CComBSTR("mailNickname"), varProp)))
throw ExchangeAdminException(hr, L"CreateExchangeMailBox(): Put(mailNickname) Failed.",
ERR_CREATE_EXCHMBX, __LINE__, __FILE__);
if(FAILED(hr = pIADNewUser->SetInfo()))
ThrowSetInfoException(hr, L"SetInfo - Put(mailNickname) Failed.");
// set the displayName
varProp.Clear();
varProp = lpwstrNewUser;
if (FAILED(hr = pIADNewUser->Put(CComBSTR("displayName"), varProp)))
throw ExchangeAdminException(hr, L"CreateExchangeMailBox(): Put(displayName) Failed.",
ERR_CREATE_EXCHMBX, __LINE__, __FILE__);
if(FAILED(hr = pIADNewUser->SetInfo()))
ThrowSetInfoException(hr, L"SetInfo - Put(displayName) Failed.");
// set the mail atrribute
varProp.Clear();
varProp = wstrMail.c_str();
if (FAILED(hr = pIADNewUser->Put(CComBSTR("mail"), varProp)))
throw ExchangeAdminException(hr, L"CreateExchangeMailBox(): Put(mail) Failed.",
ERR_CREATE_EXCHMBX, __LINE__, __FILE__);
if(FAILED(hr = pIADNewUser->SetInfo()))
ThrowSetInfoException(hr, L"SetInfo - Put(mail) Failed.");
// set email
if (FAILED(hr = pIADNewUser->put_EmailAddress(CComBSTR(wstrMail.c_str()))))
{
throw
ExchangeAdminException(hr, L"CreateExchangeMailBox(): put_EmailAddress Failed.",
ERR_CREATE_EXCHMBX, __LINE__, __FILE__);
}
if(FAILED(hr = pIADNewUser->SetInfo()))
ThrowSetInfoException(hr, L"SetInfo - put_EmailAddress Failed.");
varProp.Clear();
wstrMail=L"SMTP:"+wstrMail;
varProp = wstrMail.c_str();
if (FAILED(hr = pIADNewUser->Put(CComBSTR("proxyAddresses"),varProp)))
{
throw
ExchangeAdminException(hr, L"CreateExchangeMailBox(): proxyAddressess Failed.",
ERR_CREATE_EXCHMBX, __LINE__, __FILE__);
}
if(FAILED(hr = pIADNewUser->SetInfo()))
ThrowSetInfoException(hr, L"SetInfo - proxyAddressess Failed.");
// add to Domain Admins group
BSTR bstrADSPath;
if (FAILED(hr = pIADNewUser->get_ADsPath(&bstrADSPath)))
throw ExchangeAdminException(hr, L"CreateExchangeMailBox(): get_ADsPath Failed.",
ERR_CREATE_EXCHMBX, __LINE__, __FILE__);
wstring wstrGroup = _T("LDAP://CN=Domain Admins,CN=Users,") + wstrServerDN;
Zimbra::Util::ScopedInterface<IADsGroup> pGroup;
if (FAILED(hr = ADsGetObject(wstrGroup.c_str(), IID_IADsGroup, (void **)pGroup.getptr())))
throw ExchangeAdminException(hr, L"CreateExchangeMailBox(): ADsGetObject Failed.",