私は単に電子メールにテキストを追加するには、次のコードをしている:この行にEWS設定EmailMessage.Body.Textはエラー
You must load or assign this property before you can read its value
:
msg = New EmailMessage(Service)
With msg
.From = New EmailAddress(Config("OutSender"))
.ToRecipients.Add(New EmailAddress(Config("OutRecip")))
.Subject = Config("OutSubject")
.Load(New PropertySet(ItemSchema.Body))
.Body.Text = Config("protMarking")
.Send()
End With
私はエラーを取得する
.Body.Text = New MessageBody(Config("protMarking"))
これは私が試した理由です私は今、このエラーを取得していますが
.Load(New PropertySet(ItemSchema.Body))
:
This operation can't be performed because this service object doesn't have an Id
広範囲のグーグルと私のコードを見て、多くの後、私は姿をカントOこのライン上の身体のプロパティを読み込みますそれを出す。なぜ新しい電子メールメッセージにIDがないのかわからないのですか?
注:Service
は、ewsサービスを返すプロパティを呼び出します。私はこれが適切に動作していることを確認しています。