我有以下CDO.Message对象。
dim myMail:set myMail= CreateObject("CDO.Message")
myMail.Subject="testSubject"
myMail.From="test@test.com"
myMail.to="test@test.com"
myMail.TextBody="testBody"
我想将此对象转换为字符串。如下面的asp.net函数所做的那样
public static string ConvertCDOtoString(CDO.Message CDOMsg)
{
string strMessage = "";
//Convert CDO Message to ADO Stream
ADODB.Stream objADO = null;
objADO = CDOMsg.GetStream();
objADO.Type = ADODB.StreamTypeEnum.adTypeBinary;
//Convert ADO Stream to String
strMessage = System.Text.Encoding.ASCII.GetString((byte[])objADO.Read());
objADO = null;
return strMessage;
}
我想在asp经典中做同样的事情。有人可以帮忙吗
答案 0 :(得分:1)
得到了解决方案。
dim myMail:set myMail= CreateObject("CDO.Message")
myMail.Subject="test subject"
myMail.to="test@test.com"
myMail.TextBody="testing Body message "
myMail.From="test2@test.com"
Dim Stream
Set Stream = myMail.GetStream()
'read the encoded data As a string
messageString = Stream.ReadText