title: sending mailchimp campaign in asp.net
body: <p>I'm trying to send a mail chimp campaign using asp.net, actually i created successfully the campaign and i can see it through my profile but also i want to send it through my code here is my code so if any one can help!!</p>
  
  <pre><code>private static void CreateCampaignAndSend(string apiKey, string listID)
          {
              Int32 TemplateID = 0;
              string campaignID = string.Empty;
  
  
  
              // compaign Create Options
              var campaignCreateOpt = new campaignCreateOptions
                                          {
                                              list_id = listID,
                                              subject = "subject",
                                              from_email = "cbx@abc.com",
                                              from_name = "abc",
                                              template_id = TemplateID
                                          };
  
              // Content
  
              var content = new Dictionary&lt;string, string&gt;
                                {
                                    {"html", "Lots of cool stuff here."}
                                };
  
              // Conditions
              var csCondition = new List&lt;campaignSegmentCondition&gt;();
              var csC = new campaignSegmentCondition {field = "interests-" + 123, op = "all", value = ""};
  
              csCondition.Add(csC);
  
              // Options
              var csOptions = new campaignSegmentOptions {match = "all"};
  
  
              // Type Options
              var typeOptions = new Dictionary&lt;string, string&gt;
                                    {
                                        {"offset-units", "days"},
                                        {"offset-time", "0"},
                                        {"offset-dir", "after"}
                                    };
  
              // Create Campaigns
  
              var campaignCreate = new campaignCreate(new campaignCreateInput(apiKey, EnumValues.campaign_type.plaintext, campaignCreateOpt, content, csOptions, typeOptions));
              campaignCreateOutput ccOutput = campaignCreate.Execute();
              campaignSendNow c=new campaignSendNow();
              List&lt;Api_Error&gt; error = ccOutput.api_ErrorMessages;  // Catching API Errors
  
  
              if (error.Count &lt;= 0)
              {
                  campaignID = ccOutput.result;
              }
              else
              {
                  foreach (Api_Error ae in error)
                  {
                      Console.WriteLine("\n ERROR Creating Campaign : ERRORCODE\t:" + ae.code + "\t ERROR\t:" + ae.error);
  
                  }
              }
  
          }
  </code></pre>