Skip to content

Can we make Email threads using JCOB in outlook? #4

@sayedsadat344

Description

@sayedsadat344

I am using JCOB with java to open Outlook and create HTML-content email, which is working fine.

I want to track the emails and emails having same subject and cc should be created as thread i.e. reply to the previous email.

here is my code

    public void createEmail(String subject, String recipientTo, String recipientCC, String recipientBCC, String body, EmployeeDto authenticatedUser, DesignationDto userDesignation) {
        // Append the signature to the email body
        String fullEmailContent = getFullEmailBodyContent(body,authenticatedUser,userDesignation);

        Dispatch mail = Dispatch.call(oOutlook, "CreateItem", email).toDispatch();
        Dispatch.put(mail, "Subject", subject);
        Dispatch.put(mail, "To", recipientTo);
        Dispatch.put(mail, "CC", recipientCC);
        Dispatch.put(mail, "BCC", recipientBCC);

        System.out.println("OUTLOOK OPENING ........\n");


        // Set the full body with the signature
        Dispatch.put(mail, "HTMLBody", fullEmailContent);

//        Save on D drive
        Dispatch.call(mail, "SaveAs","D:\\JacobEmail.msg");
//        Display in outlook
        Dispatch.call(mail, "Display");
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions