本文整理汇总了C++中Contact::GetIdnaEmail方法的典型用法代码示例。如果您正苦于以下问题:C++ Contact::GetIdnaEmail方法的具体用法?C++ Contact::GetIdnaEmail怎么用?C++ Contact::GetIdnaEmail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Contact
的用法示例。
在下文中一共展示了Contact::GetIdnaEmail方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleVRFY
wxmailto_status Smtp::HandleVRFY(Contact& address)
{
wxString idna_email = address.GetIdnaEmail();
if (idna_email.IsEmpty())
return LOGERROR(ID_INVALID_FORMAT);
wxmailto_status status;
wxString read_string, write_string;
//Send VRFY, RFC821 §4.1.2
write_string = "VRFY "+idna_email+s_CRLF;
if (ID_OK!=(status=Write(write_string, s_raw_encoding)))
return status;
//Read server-response
wxInt smtp_status;
wxBool more = true;
while (more)
{
if (ID_OK!=(status=ReadLine(read_string, s_raw_encoding)))
return status;
smtp_status = SmtpStatus(read_string, more);
}
Contact* found_email = NULL;
switch(smtp_status) //RFC821 §4.3
{
case 251: if (ID_OK!=(status=ParseVRFY_EXPAND(read_string, found_email)))
return status;
//else Success, fallthrough
case 250: break;
case 550: //Failure, fallthrough
case 551:
case 553: if (ID_OK!=(status=ParseVRFY_EXPAND(read_string, found_email)))
return status;
break; //If we find an address, consider this a success
case 500: //Error, fallthrough
case 501:
case 502:
case 504:
case 421:
default: return LOGERROR(ID_ERROR_FROM_SERVER);
}
if (found_email)
{
address.SetEmail(found_email->GetEmail());
delete found_email;
}
return ID_OK;
}
示例2: HandleEXPAND
wxmailto_status Smtp::HandleEXPAND(const Contact& address, ContactList& addresses)
{
wxString idna_email = address.GetIdnaEmail();
if (idna_email.IsEmpty())
return LOGERROR(ID_INVALID_FORMAT);
wxmailto_status status;
wxString read_string, write_string;
//Send EXPN, RFC821 §4.1.2
write_string = "EXPN "+idna_email+s_CRLF;
if (ID_OK!=(status=Write(write_string, s_raw_encoding)))
return status;
//Read server-response
Contact* found_email = NULL;
wxBool more = true;
while (more)
{
if (ID_OK!=(status=ReadLine(read_string, s_raw_encoding)))
return status;
switch(SmtpStatus(read_string, more)) //RFC821 §4.3
{
case 250: if (ID_OK!=(status=ParseVRFY_EXPAND(read_string, found_email)))
return status;
if (found_email)
addresses.Append(found_email);
break;
case 550: //Failure, fallthrough
case 500: //Error, fallthrough
case 501:
case 502:
case 504:
case 421:
default: return LOGERROR(ID_ERROR_FROM_SERVER);
}
}
return ID_OK;
}