0

I am using Soap API to send email,if my List id is wrong it create a new List,so it is making a huge number of unwanted lists,Idealy the call must return with error .iam now doing a retreive to check the list id is valid and send mail ,it is time consuming so any idea to solve this issue?

Email send Object as below

    Send sendobj = new Send()
    {
        FromName = "nikhil",
        FromAddress = "nikhil@gmail.com",

        Email = new Email()
        {
            HTMLBody = "Body",
            TextBody = "text",
            Subject = "subject",
            Name = "name"
        },

        // Setting SubscriberList 
        List = new List[1]
        {
            new List
            {
                ID = 50, 
                IDSpecified = true 
            }
        }
    };


 string cRequestID = string.Empty;
 string cStatus = string.Empty;
 CreateResult[] cResults = client.Create(new CreateOptions(), new APIObject[] { sendobj }, out cRequestID, out cStatus); // Send Message

if the value 50 as List id is an invalid id then it will create a fake list in exact target account,is that correct?

  • am i doing wrong? or question is not clear? – Nikhil K S Dec 19 '13 at 6:14
  • Not really sure what you are asking - do you want to know about new lists, or how to call by list ID? – Kelly J Andrews Dec 19 '13 at 18:43
  • i have an issue that if a user want to send email to subscriber list and if they enter a invalid listid then the api call get success status,that is my problem – Nikhil K S Dec 20 '13 at 5:12
  • I'm sorry - I'm not recognizing what language this is - is this an SDK? Is there a code sample you based this off of? I don't recognize this at all. – Kelly J Andrews Dec 20 '13 at 11:02
1

A simple SOAP packet for sending to a list -

<soap:Body>
    <CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
        <Options/>
        <Objects xsi:type="Send">
            <ObjectID xsi:nil="true"/>
            <Email>
                <ID>12345</ID>
            </Email>
            <List>
                <ID>12345</ID>
            </List>
        </Objects>
    </CreateRequest>
</soap:Body>

This SOAP body will send to an email to a listID.

The list ID needs to be in your account, or the call should fail. Not exactly sure what success you are getting, or what is meant by a new list being created. This would allow you to then send directly to a list, and would be good for sending occasionally.

If you wish to create an EmailSendDefintion, you would base your code off the sample you are already looking at. The code you have above doesn't appear to be doing any of that sample.

| improve this answer | |
  • Were you able to get this working? – Kelly J Andrews Dec 23 '13 at 23:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.