PublicAPI.CRM.Relationship.CreateMail ELMA API Documentation
Create Mail for a contact. Creates an object without saving to the database
 
 
Syntax

public RelationshipMail CreateMail(
	Contact contact
)

Parameters

contact
Type: Contact
Contact, the mail is created for. Object. Access path: PublicAPI.CRM.Contact

Return Value

Type: RelationshipMail
Mail
Examples

//load a contact by ID 
var contact = PublicAPI.CRM.Contact.Load(3);

//create mail 
var myMail = PublicAPI.CRM.Relationship.CreateMail(contact);

//myMail - created mail 

//WARNING!! Mail is created without a name. For correct work with the mail, you should 
//specify its name and sabe the object to the database
myMail.Theme = "Mail Name";
myMail.Save();
See Also