在用cdo.message做邮件发送,用163邮箱给qq邮箱发邮件,怎么设置优先级。具体代码如下:
CDO.Message cdoMess = new CDO.Message();
cdoMess.From = "user@163.com";
cdoMess.Subject = "哈哈";
cdoMess.TextBody = "很高兴";
cdoMess.To = "user@qq.com";
cdoMess.Fields["urn:schemas:mailheader:importance"].Value = "high";
cdoMess.Fields.Update();
CDO.IConfiguration iConfg;
ADODB.Fields oFields;
iConfg = cdoMess.Configuration;
oFields = iConfg.Fields;
oFields["http://schemas.microsoft.com/cdo/configuration/sendusing"].Value = 2;
oFields["http://schemas.microsoft.com/cdo/configuration/sendemailaddress"].Value = "user@163.com";//
oFields["http://schemas.microsoft.com/cdo/configuration/smtpaccountname"].Value = "user@163.com";//
oFields["http://schemas.microsoft.com/cdo/configuration/sendusername"].Value = "user@163.com";//用户名
oFields["http://schemas.microsoft.com/cdo/configuration/sendpassword"].Value = "password"; //密码
oFields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"].Value = 1; //验证方式 0不需验证 1代表BASIC认证 2代表NTLM验证方式
oFields["http://schemas.microsoft.com/cdo/configuration/smtpserver"].Value = "smtp.163.com"; //smtp主机名
oFields.Update();
try
{
cdoMess.Send();
cdoMess = null;
}
catch
{
}
finally
{
MessageBox.Show("发送成功!");
}
以上代码(用户名和密码不用理~)发送到有些邮箱可以正常显示优先级,已测试。但是163发到qq邮箱就不行了,请达人赐教,谢谢。