Exemple #1
0
        public IActionResult Index()
        {
            //MailerModel mdl = new MailerModel("d:\\others\\ES_Emails",@"Views\Email\_EmailLayout.html")//Host name and port number
            //{
            //    User = "******",
            //    Key = "Your Key",
            //    FromAddress = "*****@*****.**",// [email protected]
            //    IsHtml = true,
            //    ViewFile = @"Views\Email\EmailContent.html"
            //};
            MailerModel mdl = new MailerModel
            {
                User               = "******",
                Key                = "Your Key",
                FromAddress        = "*****@*****.**",// [email protected]
                IsHtml             = false,
                PickupPath         = "d:\\others\\ES_Emails",
                UsePickupDirectory = true,
                Message            = "Hi {UserName}," + Environment.NewLine +
                                     $"This is test email {Environment.NewLine}" +
                                     $"Regards, {Environment.NewLine}" +
                                     "{OrganizationName}"
            };

            mdl.Model = new UserModel
            {
                UserName         = "******",
                OrganizationName = "Riy Technologies AB"
            };
            mdl.ToAddresses.Add("*****@*****.**");
            _coreMailer.Send(mdl);
            return(View());
        }
Exemple #2
0
        public IActionResult SendToFolder()
        {
            MailerModel mdl = new MailerModel("E:\\Home\\emailPickup")            //Host name and port number
            {
                User        = "******",
                Key         = "Your Key",
                FromAddress = "*****@*****.**",                // [email protected]
                IsHtml      = true,
            };


            mdl.ViewFile = "Home/email_view";
            mdl.Model    = new UserModel
            {
                OrganizationName = "Test Organization"
            };
            mdl.ToAddresses.Add("*****@*****.**");
            _mailer.Send(mdl);
            return(Ok());
        }