We are trying to create an Email Send Definition from a landing page. Ampscript is calling out to get a Send Classification object that will be a part of the Email Send Definition:

SET @send_class_create = CreateObject("SendClassification")

SetObjectProperty(we set Send Classification properties here)

set @sendClass = InvokeCreate(@send_class_create,@statusMsg, @errorCode)

We now have a send classification object created. We will now use that object to define the Send Classification within the Email Send Definition object:

SET @cr = CreateObject("EmailSendDefinition")

SetObjectProperty(@cr, "Name","test")

SetObjectProperty(@cr, "SendClassification",@sendClass)

SendClassification property requires a data type of SendClassification object according to the documentation.


If we try and run this code on a landing page the page returns an error:

Object of type 'System.String' cannot be converted to type 'ExactTarget.Integration.WSDL.SendClassification'.

The function expression is invalid. See inner exception for detail.

Script: SetObjectProperty(@cr, "SendClassification", @sendClass)

The system seems to be casting the SendClassification object into a string object. I am specifically defining the object as the required type so I am not sure why the system is turning the object into a string object.

1 Answer 1


You might check the sample code on this page. It's specific to a TriggeredSendDefinition, but it shows how to set the SendClassification:

tsd.SendClassification = new SendClassification();

//Available in the ET UI [Admin > Send Management > Send Classifications > Edit Item > External Key]
tsd.SendClassification.CustomerKey = "4201"; //required 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .