当前位置: 首页>>代码示例>>C++>>正文


C++ Contact::GetIdnaEmail方法代码示例

本文整理汇总了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;
}
开发者ID:frodegill,项目名称:wxMailto,代码行数:54,代码来源:smtp.cpp

示例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;
}
开发者ID:frodegill,项目名称:wxMailto,代码行数:43,代码来源:smtp.cpp


注:本文中的Contact::GetIdnaEmail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。