private void SendMailInternal(NativeActivityContext context, string mailBody)
        {
            var mail = $"{Environment.NewLine}From: {FromAddress.Get(context)}" +
                       $"{Environment.NewLine}To: {RecipientAddress.Get(context)}" +
                       $"{Environment.NewLine}Subject: {Subject.Get(context)}" +
                       $"{Environment.NewLine}Body: {mailBody}";

            Console.WriteLine(mail);
        }
Beispiel #2
0
        protected override void Execute(CodeActivityContext context)
        {
            var msg = new MailMessage(FromAddress.Get(context),
                                      RecipientAddress.Get(context),
                                      Subject.Get(context),
                                      MailBody.Get(context));

            using (var client = new SmtpClient())
            {
                client.Send(msg);
            }
        }