Search in sources :

Example 6 with SendMsgRequest

use of com.zimbra.soap.mail.message.SendMsgRequest 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

SendMsgRequest (com.zimbra.soap.mail.message.SendMsgRequest)6 MsgToSend (com.zimbra.soap.mail.type.MsgToSend)6 Test (org.junit.Test)5 ZMimeMessage (com.zimbra.common.zmime.ZMimeMessage)4 DeliveryOptions (com.zimbra.cs.mailbox.DeliveryOptions)4 Message (com.zimbra.cs.mailbox.Message)4 ParseMimeMessage (com.zimbra.cs.service.mail.ParseMimeMessage)4 MimeMessage (javax.mail.internet.MimeMessage)4 SharedByteArrayInputStream (javax.mail.util.SharedByteArrayInputStream)4 Mailbox (com.zimbra.cs.mailbox.Mailbox)3 MimePartInfo (com.zimbra.soap.mail.type.MimePartInfo)3 Ignore (org.junit.Ignore)3 ZMimeMultipart (com.zimbra.common.zmime.ZMimeMultipart)2 LinkedList (java.util.LinkedList)2 Element (com.zimbra.common.soap.Element)1 SoapTransport (com.zimbra.common.soap.SoapTransport)1 SendMsgResponse (com.zimbra.soap.mail.message.SendMsgResponse)1 AttachmentsInfo (com.zimbra.soap.mail.type.AttachmentsInfo)1 EmailAddrInfo (com.zimbra.soap.mail.type.EmailAddrInfo)1 MimePartAttachSpec (com.zimbra.soap.mail.type.MimePartAttachSpec)1