1
Vote

campaignSendTest not sending test mail(s), but returning True as a result

description

I'm using the campaignSendTest method through the PerceptiveMCAPI wrapper (version 1.3.0.0) but although [True] is returned no test mails are sent.
Sending test mails from the MailChimp site works like magic, immediate a test e-mail in my Inbox.
 
ASP.NET (VB) code used;
 
''' <summary>
''' Test-send a Campaign
''' </summary>
''' <param name="strCampaignID"></param>
''' <param name="lstEmailAddresses">array of mail addresses to send test mail to</param>
''' <returns></returns>
''' <remarks></remarks>
Public Shared Function CampaignSendTest(strCampaignID As String, lstEmailAddresses As List(Of String)) As Boolean
 
Dim blSent As Boolean = False
 
If Not String.IsNullOrEmpty(strCampaignID) AndAlso lstEmailAddresses.Count > 0 Then
 
  Dim strApiKey As String = GetApiKey()
 
  'Dim input As New PerceptiveMCAPI.Types.campaignSendTestInput(strApiKey, strCampaignID, lstEmailAddresses, enumSendType)
  'http://groups.google.com/group/mailchimp-api-discuss/browse_thread/thread/90e5f92e6fb329fb?pli=1
  'http://apidocs.mailchimp.com/api/1.3/campaignsendtest.func.php
  Dim input As New PerceptiveMCAPI.Types.campaignSendTestInput(strApiKey, strCampaignID, lstEmailAddresses, Nothing)
  Dim cmd As New PerceptiveMCAPI.Methods.campaignSendTest(input)
  Dim output As PerceptiveMCAPI.Types.campaignSendTestOutput = cmd.Execute()
 
  If output.api_ErrorMessages.Count > 0 Then
    Dim sbErrors As New System.Text.StringBuilder
    For Each errr In output.api_ErrorMessages
      sbErrors.AppendLine("Code: " & errr.code & ", error: " & errr.error)
    Next
    Throw New Exception("#ERROR(S)#" & vbCrLf & sbErrors.ToString)
  Else
    blSent = output.result
  End If
 
  'Clean up
  output = Nothing
  cmd = Nothing
  input = Nothing
End If
 
Return blSent
 
End Function 'CampaignSendTest

comments