Microsoft.Protocols.TestSuites.MS_ASAIRS.TestSuiteBase.SendEmail C# (CSharp) Method

SendEmail() protected method

The method is used to send a mail
protected SendEmail ( EmailType emailType, string subject, string body ) : void
emailType EmailType The type of the email.
subject string The subject of the mail.
body string The body of the item.
return void
        protected void SendEmail(EmailType emailType, string subject, string body)
        {
            SendMailRequest request = new SendMailRequest
            {
                RequestData =
                {
                    ClientId = Guid.NewGuid().ToString("N"),
                    Mime = TestSuiteHelper.CreateMIME(
                        emailType,
                        Common.GetMailAddress(this.User1Information.UserName, this.User1Information.UserDomain),
                        Common.GetMailAddress(this.User2Information.UserName, this.User2Information.UserDomain),
                        subject,
                        body)
                }
            };

            SendMailResponse sendMailResponse = this.ASAIRSAdapter.SendMail(request);
            this.Site.Assert.AreEqual<string>(
                 string.Empty,
                 sendMailResponse.ResponseDataXML,
                 "The server should return an empty XML body to indicate SendMail command is executed successfully.");

            this.SwitchUser(this.User2Information, true);
            this.RecordCaseRelativeItems(this.User2Information.UserName, this.User2Information.InboxCollectionId, subject);
        }
        #endregion