Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

System.Runtime.Serialization.SerializationException #203

Open
serena-alfapi opened this issue Dec 14, 2016 · 2 comments
Open

System.Runtime.Serialization.SerializationException #203

serena-alfapi opened this issue Dec 14, 2016 · 2 comments

Comments

@serena-alfapi
Copy link

serena-alfapi commented Dec 14, 2016

Hi,

when I try to create a campaign, I receive this error:

Type definitions should start with a '{', expecting serialized type 'ApiError', got string starting with:

<TITLE>Access Denied</TITLE> <

Site hosted on smarterasp.net.

Please, Help me!
thank you for all kind of support!

@danesparza
Copy link
Owner

Hmmm ... can you do any operations with Mailchimp? What operations appear to work -- which don't?

@serena-alfapi
Copy link
Author

Thank's for reply.
Yes I can do everything. It's possible to create and send a campaing using mailchimp site.

This is the code I use to send using vb.net:

Imports MailChimp (using Nuget MailChimp.NET)

Public Shared Function AUTOMATIC_MAILCHIMP_SEND(ByVal _url As String, ByVal _oggetto As String, ByVal listId As String, ByVal _d As String) As String
Dim _esito As String
Dim apiKey As String = "XXXXXXXXX"
Dim mc As MailChimpManager = New MailChimpManager(apiKey)
Dim messaggio As New MailChimp.Campaigns.CampaignCreateContent
Dim _d2() As String
Dim _destinatari As New List(Of String)

_d2 = Split(_d, ";")
For _i = 0 To _d2.Count - 1
_destinatari.Add(_d2(_i))
Next

messaggio.Url = _url (the url where I saved newsletter.htm in the same server)
Dim options As New MailChimp.Campaigns.CampaignCreateOptions
With options
.ListId = listId
.Subject = _oggetto
.FromEmail = "XXX@XXX.com"
.FromName = "XXXXX"
End With
Dim campagna As New MailChimp.Campaigns.Campaign
campagna = mc.CreateCampaign("regular", options, messaggio)
Dim campagnaid As String = campagna.Id
Dim result As New MailChimp.Campaigns.CampaignActionResult

============================= ERROR HERE =============================

result = mc.SendCampaignTest(campagnaid, _destinatari)

===================================================================

Select Case result.Complete.ToString
Case "True"
_esito = "ok"

Case Else
_esito = "KO"
End Select

Return _esito
End Function

thank's

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants