Пример #1
0
        /// <summary>
        /// Send a plain text email.
        /// </summary>
        /// <param name="subject">The subject of email</param>
        /// <param name="cc">The cc address of the mail</param>
        /// <param name="bcc">The bcc address of the mail</param>
        protected void SendPlaintextEmail(string subject, string cc, string bcc)
        {
            string emailBody = Common.GenerateResourceName(Site, "content");
            string emailMime = TestSuiteHelper.CreatePlainTextMime(
                Common.GetMailAddress(this.User1Information.UserName, this.User1Information.UserDomain),
                Common.GetMailAddress(this.User2Information.UserName, this.User2Information.UserDomain),
                cc,
                bcc,
                subject,
                emailBody);
            string clientId = TestSuiteHelper.GetClientId();

            SendMailRequest sendMailRequest = TestSuiteHelper.CreateSendMailRequest(clientId, false, emailMime);

            this.SwitchUser(this.User1Information, false);
            SendMailResponse response = this.EMAILAdapter.SendMail(sendMailRequest);

            Site.Assert.AreEqual <string>(
                string.Empty,
                response.ResponseDataXML,
                "The server should return an empty xml response data to indicate SendMail command executes successfully.");

            this.SwitchUser(this.User2Information, true);
            this.RecordCaseRelativeItems(this.User2Information.UserName, this.User2Information.InboxCollectionId, subject);
        }
Пример #2
0
        /// <summary>
        /// Send a plain text email.
        /// </summary>
        /// <param name="subject">The subject of email</param>
        /// <param name="cc">The cc address of the mail</param>
        /// <param name="bcc">The bcc address of the mail</param>
        /// <param name="to">The to address of the mail</param>
        /// <param name="sender">The sender address of the mail</param>
        /// <param name="replyTo">The replyTo address of the mail</param>
        /// <param name="from">The from address of the mail</param>
        protected void SendPlaintextEmail(
            string subject,
            string cc,
            string bcc,
            string to,
            string sender,
            string replyTo,
            string from)
        {
            string emailBody = Common.GenerateResourceName(Site, "content");

            string emailMime = TestSuiteHelper.CreatePlainTextMime(
                string.IsNullOrEmpty(from) ? Common.GetMailAddress(this.User1Information.UserName, this.User1Information.UserDomain) : from,
                string.IsNullOrEmpty(to) ? Common.GetMailAddress(this.User2Information.UserName, this.User2Information.UserDomain) : to,
                cc,
                bcc,
                subject,
                emailBody,
                sender,
                replyTo);
            string clientId = TestSuiteHelper.GetClientId();

            SendMailRequest sendMailRequest = TestSuiteHelper.CreateSendMailRequest(clientId, false, emailMime);

            this.SwitchUser(this.User1Information, false);
            SendMailResponse response = this.EMAILAdapter.SendMail(sendMailRequest);

            Site.Assert.AreEqual <string>(
                string.Empty,
                response.ResponseDataXML,
                "The server should return an empty xml response data to indicate SendMail command was executed successfully.");
        }