vc下基于SMTP协议的发送电子邮件代码
retun FALSE;
}
//在CMailMessage中封装了“格式化”消息的功能
msg->FormatMessage();
return TRUE;
}
void CMailMessage::FormatMessage()
{
start_header();
prepare_header();
end_header();
prepare_body();
}
void CMailMessage::start_header()
{
m_sHeader=_T("");
}
void CMIMEMessage::prepare_header()
{
CString strTemp;
//由基类的函数来添加邮件头
CMailMessage::prepare_header();
//这里只添加MIME头
add_header_line(_T("MIME-Version:1.0"));
strTemp.Format(_T("Content-Type: %s;boundary=%s"),
(LPCTSTR) m_sMIMEContentType,
(LPCTSTR) m_sPartBoundary);
add_header_line((LPCTSTR) strTemp);
}