コード例 #1
0
        public void SendVerificationPassToEmail(String Toemail, string merchantpassword)
        {
            ZenderMessage message = new ZenderMessage("eaf7f170-f8e8-4391-8e5b-eb1919fca608");

            MailAddress from = new MailAddress("*****@*****.**");

            MailAddress to = new MailAddress(Toemail);



            message.From = from;

            message.To.Add(to);

            message.Subject = "Your Marchent account successfully created";

            message.Body = "Thank you for for your patience." +
                           "<br />Your Easy Billing merchant account have been successfully created. " +

                           "<br /><b> Your email id: </b><b>" + Toemail + "</b>" +
                           " <br /><b> Password: </b><b>" + merchantpassword + "</b>" +
                           " <br />If you facing any problem, Please mail at [email protected] or [email protected] .We will be always available for you and give support happily";

            message.IsBodyHtml = true;

            message.SendMailAsync();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: sharptag/zender
 static void Main(string[] args)
 {
     //You can register your e-mail address to get the API Key
     ZenderMessage message = new ZenderMessage("Your zender API Key");
     MailAddress from = new MailAddress("*****@*****.**");
     MailAddress to = new MailAddress("*****@*****.**");
     message.From = from;
     message.To.Add(to);
     message.Subject = "Welcome!";
     message.Body = "<p><b>Lorem ipsum</b> dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>";
     message.IsBodyHtml = true;
     message.SendMailAsync();
 }
コード例 #3
0
        //GET: Email
        //public static IRestResponse EmailNotification()
        //{
        //    RestClient client = new RestClient();
        //    client.BaseUrl = new Uri("https://api.mailgun.net/v3");
        //    client.Authenticator =
        //        new HttpBasicAuthenticator("api",
        //                                    "key-a5d1a068-f46988d9");
        //    RestRequest request = new RestRequest();
        //    request.AddParameter("domain", "samples.mailgun.org", ParameterType.UrlSegment);
        //    request.Resource = "{domain}/messages";
        //    request.AddParameter("from", "CapstoneName <*****@*****.**>");//[email protected]>");
        //    request.AddParameter("to", "*****@*****.**");
        //    request.AddParameter("to", "samples.mailgun.org");
        //    request.AddParameter("subject", "Test");
        //    request.AddParameter("text", "This is a test Email");
        //    request.Method = Method.POST;
        //    return client.Execute(request);
        //}
        //static void Main(string[] args)
        //{
        //    Console.WriteLine(EmailNotification().Content.ToString());
        //}

        //private static void Main()
        //{
        //    EmailNotification().Wait();
        //}

        //static async Task EmailNotification()
        //{
        //    var apiKey = "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";
        //    var client = new SendGridClient(apiKey);
        //    var from = new EmailAddress("*****@*****.**");
        //    var subject = "Test email send";
        //    var to = new EmailAddress("*****@*****.**", "This me");
        //    var plainTextContent = "This is a test email";
        //    var htmlContent = "<strong>still testing</strong>";
        //    var msg = MailHelper.CreateSingleEmail(from, to, subject, plainTextContent, htmlContent);
        //    var response = await client.SendEmailAsync(msg);
        //}

        public ActionResult SendEmail()
        {
            ZenderMessage message = new ZenderMessage("27a1f808-107b-4a30-aa30-356fe72ab083");
            MailAddress   from    = new MailAddress("*****@*****.**");
            MailAddress   to      = new MailAddress("*****@*****.**");

            message.From = from;
            message.To.Add(to);
            message.Subject    = "Welcome!";
            message.Body       = "<p><b>Lorem ipsum</b> dolor sit amet, consectetur adipiscing elit.</p>";
            message.IsBodyHtml = true;
            message.SendMailAsync();
            return(View("~/Views/Home/Index.cshtml"));
        }