How to integrate MailChimp in C#/.Net

前端 未结 6 1056
遇见更好的自我
遇见更好的自我 2021-01-30 14:26

I want to send email through MailChimp. How to do this in .Net?

Does any one have sample code?

Thanks.

相关标签:
6条回答
  • 2021-01-30 15:07

    You can try this on CodePlex:

    mcapinet

    0 讨论(0)
  • 2021-01-30 15:11

    For the support of latest Mail Chimp 3.0 API, you can find wrapper for .Net on:

    MailChimp.Net - A Mail Chimp 3.0 Wrapper

    https://github.com/brandonseydel/MailChimp.Net

    0 讨论(0)
  • 2021-01-30 15:15

    Take a look at the PerceptiveMCAPI on CodePlex:

    PerceptiveMCAPI - A .NET friendly wrapper for the MailChimp Api written in C# by Perceptive Logic.

    http://perceptivemcapi.codeplex.com/

    0 讨论(0)
  • 2021-01-30 15:18

    try using mailchimp's newest service - Mandrill (Transactional email service)

    you can use it via standard smtp or api.

    http://mandrillapp.com/

    0 讨论(0)
  • 2021-01-30 15:19

    Do Check out https://github.com/danesparza/MailChimp.NET by Dan Esparza You can install the package by using Package Manager Console

    Install-Package MailChimp.NET

    Code example

    MailChimpManager mc = new MailChimpManager("YourApiKeyHere-us2");
    ListResult lists = mc.GetLists();

    For email sending and stats, Mailchimp offers Mandrill by Shawn Mclean https://github.com/shawnmclean/Mandrill-dotnet

    You can install Mandrill using

    Install-Package Mandrill

    Code example

    MandrillApi api = new MandrillApi("xxxxx-xxxx-xxxx-xxxx");
    UserInfo info = await api.UserInfo();
    0 讨论(0)
  • 2021-01-30 15:21

    The example below will send a opt-in email:

    First install the NuGet package: Install-Package mcapi.net

        static void Main(string[] args)
        {
            const string apiKey = "6ea5e2e61844608937376d514-us2";   // Replace it before
            const string listId = "y657cb2495";                      // Replace it before
    
            var options = new List.SubscribeOptions();
            options.DoubleOptIn = true;
            options.EmailType = List.EmailType.Html;
            options.SendWelcome = false;
    
            var mergeText = new List.Merges("email@provider.com", List.EmailType.Text)
                        {
                            {"FNAME", "John"},
                            {"LNAME", "Smith"}
                        };
            var merges = new List<List.Merges> { mergeText };
    
            var mcApi = new MCApi(apiKey, false);
            var batchSubscribe = mcApi.ListBatchSubscribe(listId, merges, options);
    
            if (batchSubscribe.Errors.Count > 0)
                Console.WriteLine("Error:{0}", batchSubscribe.Errors[0].Message);
            else
                Console.WriteLine("Success");
    
            Console.ReadKey();
        }
    
    0 讨论(0)
提交回复
热议问题