Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
JMSG
>
Tutorial
> Create contact
The following example shows you how to create a contact item.
import java.io.IOException; import com.independentsoft.msg.Message; public class Example { public static void main(String[] args) { try { Message contact = new Message(); contact.setMessageClass("IPM.Contact"); contact.setSubject("John Smith"); contact.setDisplayNamePrefix("Mr."); contact.setDisplayName("John Smith"); contact.setGivenName("John"); contact.setSurname("Smith"); contact.setCompanyName("Independentsoft"); contact.setEmail1Address("john@independentsoft.com"); contact.setEmail1DisplayAs("John"); contact.setEmail1DisplayName("John"); contact.setEmail1Type("SMTP"); contact.setBusinessAddressCity("NY"); contact.setBusinessAddressStreet("First Street"); contact.setBusinessAddressCountry("USA"); contact.setBusinessAddress("First Street, NY, USA"); contact.setBusinessPhone("555-666-777"); contact.save("c:\\temp\\contact.msg", true); } catch (IOException e) { e.printStackTrace(); } } }
Need help? Ask our developers:
Name*
Email*
Message*