Search in sources :

Example 1 with SendMsgResponse

use of com.zimbra.soap.mail.message.SendMsgResponse in project zm-mailbox by Zimbra.

the class TestExpandGroupInfo method sendMsg.

private void sendMsg(Account authAcct, String toAddress, String subject, String content) throws Exception {
    SoapTransport transport = authUser(authAcct.getName());
    MsgToSend msg = new MsgToSend();
    EmailAddrInfo toAddr = new EmailAddrInfo(toAddress);
    toAddr.setAddressType(EmailType.TO.toString());
    msg.addEmailAddress(toAddr);
    msg.setSubject(subject);
    MimePartInfo mp = new MimePartInfo();
    mp.setContentType("text/plain");
    mp.setContent(content);
    msg.setMimePart(mp);
    SendMsgRequest req = new SendMsgRequest();
    req.setMsg(msg);
    SendMsgResponse resp = invokeJaxb(transport, req);
}
Also used : EmailAddrInfo(com.zimbra.soap.mail.type.EmailAddrInfo) MsgToSend(com.zimbra.soap.mail.type.MsgToSend) MimePartInfo(com.zimbra.soap.mail.type.MimePartInfo) SendMsgRequest(com.zimbra.soap.mail.message.SendMsgRequest) SendMsgResponse(com.zimbra.soap.mail.message.SendMsgResponse) SoapTransport(com.zimbra.common.soap.SoapTransport)

Aggregations

SoapTransport (com.zimbra.common.soap.SoapTransport)1 SendMsgRequest (com.zimbra.soap.mail.message.SendMsgRequest)1 SendMsgResponse (com.zimbra.soap.mail.message.SendMsgResponse)1 EmailAddrInfo (com.zimbra.soap.mail.type.EmailAddrInfo)1 MimePartInfo (com.zimbra.soap.mail.type.MimePartInfo)1 MsgToSend (com.zimbra.soap.mail.type.MsgToSend)1