Programmatically set signatures in Outlook client using JAVA - java

I want to set signatures for multiple address in outlook client application. I read concepts using VBA and other scripts. But I want to do it in Java. I have already created the html signature files. I can use AD to pull user information but I don't know how to connect it with Outlook using Java. Can someone help me with this?
Thanks in advance.

Outlook Object Model does not expose signatures at all.
On the Outlook account level, the name of the signature is stored in the account profile data accessible through the IOlkAccountManager Extended MAPI interface. Since that interface is Extended MAPI, it can only be accessed using C++ or Delphi. You can see the interface and its data in OutlookSpy (I am its author) if you click the IOlkAccountManager button.:
If using Redemption is an option (I am also its author), you can use its RDOAccount object (accessible in any language, including Java). New message signature name is stored in the 0x0016001F property, reply signature is in 0x0017001F (can be read or set using RDOAccount.Fields[]).
You can also use the RDOAccount.ReplySignature and NewSignature properties.

Related

How to send an invoice email to customer using Quickbooks Online v3 Java SDK?

I would like to send an email regarding a newly created invoice to a customer programmatically using the Java SDK for QuickBooks Online. After successfully creating an invoice e.g.
com.intuit.ipp.data.Customer customer = getCustomer();
com.intuit.ipp.data.Invoice invoice = createInvoice(customer);
// what do I do now ??
The Invoice object doesn't seem to have any function that would send the email. I've looked through the QBO v3 JavaDoc and I can't see any relevant class that would help me do this (maybe something that expects an Invoice as parameter).
The preamble for the Invoice class in that JavaDoc says ...Invoice can be printed and emailed to a customer... which is why I'm assuming it is possible to do with the SDK, but I don't know that for sure.
I've also tried setting the EmailStatus field on the Invoice during creation, e.g.
invoice.setBillEmail( customer.getPrimaryEmailAddr() );
invoice.setEmailStatus( EmailStatusEnum.NEED_TO_SEND );
The only other possible values for that ENUM are NOT_SET and EMAIL_SENT. I've created a test invoice but no email has come through.
I know that there is a Restful endpoint at:
https://quickbooks.api.intuit.com/v3/company/[companyID]/invoice/[invoiceId]/send
...that can be used to email an invoice, but my question is specifically whether or not it's possible to do this using the Java v3 SDK and if so, how?
I seem to have found the answer here: https://intuitdeveloper.lc.intuit.com/questions/810174-qbo-v3-api-sending-and-linking-to-invoices
Within the Javadoc for the QBO Java SDK, see this folder: ipp-v3-java-devkit-javadoc-2.5.0
Look at the index.html and find the DataService class. It has various sendEmail() methods.
Hope this helps!

How to download refrences part of emails using java?

I am trying to download the email using imap java ..I have downloaded most of the part of email but don't know how to download references part of email?Can someone provide help about which function is used to do that?any links to some page would be helpful.Thanks
References: <CALdDwZ=PQDu2eS1R2ONsrHJDgHDeZuNCUfEsfRqC3efzZfMaqg#mail.gmail.com>
<CAAD0KRhD7w1qdRiTG6U00ShroE1R00h7F73_AQ4yRnDE7jm6HA#mail.gmail.com>
<CALdDwZm2np83PmjrHY1jO54+6-dNKaM7+oxjaUHE_rUitMffrA#mail.gmail.com>
<CAAD0KRg2TJt0Y4oo-CsOCexrmat6kHakuFZSm_AvTDuSXjiTTw#mail.gmail.com>
<CAAD0KRhXUUwNjcAhc+4h-ftiJFW7q0y9gmDRGZ0khzyzWUDxbQ#mail.gmail.com>
<CAAD0KRgp6nhupkQhu2LWe6mXGuvK35XFdZLUUjfC4uGvsOZtcQ#mail.gmail.com>
<CAAD0KRhXaJ5FAuOxR760HBzgaD-_JyXoVAymeQf+nQdCawEgGA#mail.gmail.com>
These are message Id's of all the mails which took part in a conversation..Usually this is a part of an email.so I want to download it?
For downloading the References part of the email we need to use getHeader() function of Imap java ..This is the code :
if( msg.getHeader("References")!=null)
{
String[] headers = msg.getHeader("References");
System.out.println("headers");
for(int ab=0;ab<headers.length;ab++)
System.out.println(headers[ab]);
}
The references are Message-IDs. There's no way to directly access a message given the Message-ID. You can use the Folder.search method to search for messages with the given Message-ID in the specified folder, but there's no way to know what folder the message might have been moved to, nor is there any guarantee that the current user ever saw the referenced message.

Set Outlook category on mail using Java

I'm trying to set custom categories on an email item programmatically using Java.
I found this: Setting an Outlook mailitem's category programmatically?
but I would like to do the same thing in Java. I guess some custom headers are set on the message, but I can't find information on which headers I should set. Anyone got information on this?
JMSG is Java API to create and read Outlook message files. It provides methods to set/get categories as well as many other headers.

Out of Office Agent Lotus Domino

I need to Change Subject Of Out Of Office Message through Java. At the same time I wish to enable Out of Office through java.
I tried something by myself like this :
Document dc = db.getProfileDocument("OutOfOfficeProfile", s.getUserName());
Vector vc = dc.getItems();
for(int i=0;i<vc.size();i++){
Item it = (Item) vc.get(i);
System.out.println(it.toString()+":::::::>>>>>>"
+ dc.getItemValueString(it.toString()));
}
I got the Item names as :
$Name:::::::>>>>>>$profile_018outofofficeprofile_cn=sachin jain/o=tcsapp
$UpdatedBy:::::::>>>>>>CN=Sachin Jain/O=TCSAPP
$NoPurge:::::::>>>>>>
$ConflictAction:::::::>>>>>>2
I had searched for it a lot. I came across OutOfOffice Agent though Domino Designer. But I don't know how I can change the Subject and Body Of OOO Message and how can I enable it through Java?
The OutOfOfficeProfile profile document contains all necessary data for the OutOfOffice agent to run. So if you change data in this profile document, the changes will be reflected when the OutOfOffice agent runs.
I suggest that you look at the OutOfOffice agent and see what fields it uses - and thereby what fields you need to modify to change the subject for the Out Of Office mail. A quick look in the agent tells me that the field GeneralSubject is used for the general OoO messages while the field SpecialSubject is used for the special OoO messages.
With Java you can change the profile data using the Document class (as you have alrady started to use). Remember to call dc.Save() when you change the NotesDocument fields.
With Java you can enable the agent using the Agent class and agent.setEnabled(true);.
Look in the Domino Designer Help database for more information on the classes, properties and methods.

PHP how to consume SOAP web services?

I'm very new in using web services. Appreciate if anyone can help me on this.
In my PHP codes, I'm trying to use the SOAP web services from another server (JIRA, java). The JIRA SOAP API is shown here.
$jirasoap = new SoapClient($jiraserver['url']);
$token = $jirasoap->login($jiraserver['username'], $jiraserver['password']);
$remoteissue = $jirasoap->getIssue($token, "issuekey");
I found that my codes have no problem to call the functions listed on that page. However, I don't know how to use the objects returned by the API calls.
My question are:
In my PHP codes, how can I use the methods in the Java class objects returned by SOAP API calls?
For example, the function $remoteissue = $jirasoap->getIssue($a, $b) will return a RemoteIssue. Based on this (http://docs.atlassian.com/rpc-jira-plugin/latest/com/atlassian/jira/rpc/soap/beans/RemoteIssue.html), there are methods like getSummary, getKey, etc. How can I use these functions in my codes?
Based on some PHP examples I found from the internet, it seems that everyone is using something like this:
$remoteissue = $jirasoap->getIssue($token, "issuekey");
$key = $remoteissue->key;
They are not using the object's methods.
Refer to this example, it seems that someone is able to do this in other languages. Can it be done in PHP too?
The problem I'm facing is that, I am trying to get the ID of an Attachment. However, it seems that we can't get the Attachment ID using this method: $attachmentid = $remoteattachment->id;. I am trying to use the $remoteattachment->getId() method.
In PHP codes, after we made a SOAP API call and received the returned objects, how do we know what data fields are available in that object?
For example,
$remoteissue = $jirasoap->getIssue($token, "issuekey");
$summary = $remoteissue->summary;
How do we know ->summary is available in $remoteissue?
When i refer to this document (http://docs.atlassian.com/rpc-jira-plugin/latest/com/atlassian/jira/rpc/soap/beans/RemoteIssue.html), I don't see it mention any data fields in RemoteIssue. How do we know we can get key, summary, etc, from this object? How do we know it is ->summary, not ->getsummary? We need to use a web browser to open the WSDL URL?
Thanks.
This question is over one year old, but to share knowledge and provide an answer to people who have this same question and found this page, here are my findings.
The document mentioned in the question is an overview of the JiraSoapService interface. This is a good reference for what functions can be called with which arguments and what they return.
If you use Java for your Jira SoapClient the returned objects are implemented, but if you use PHP, the returned objects aren't of the type stated in this documentation and do not have any of the methods mentioned. The returned objects are instances of the internal PHP class stdClass, which is a placeholder for undefined objects. The best way to know what is returned is to use var_dump() on the objects returned from the SoapCalls.
$jirasoap = new SoapClient($jiraserver['url']);
$token = $jirasoap->login($jiraserver['username'], $jiraserver['password']);
$remoteissue = $jirasoap->getIssue($token, "PROJ-1");
var_dump($remoteissue);
/* -- You will get something like this ---
object(stdClass)#2 (21) {
["id"]=> string(3) "100"
["affectsVersions"]=> array(0) { }
["assignee"]=> string(4) "user"
...
["created"]=> string(24) "2012-12-13T09:27:49.934Z"
...
["description"]=> string(17) "issue description"
....
["key"]=> string(6) "PROJ-1"
["priority"]=> string(1) "3"
["project"]=> string(4) "PROJ"
["reporter"]=> string(4) "user"
["resolution"]=> NULL
["status"]=> string(1) "1"
["summary"]=> string(15) "Project issue 1"
["type"]=> string(1) "3"
["updated"]=> string(24) "2013-01-21T16:11:43.073Z"
["votes"]=> int(0)
}
*/
// You can access data like this:
$jiraKey = $remoteissue->key;
$jiraProject = $remoteissue->project;
The document you referred to in #2 is to a Java implementation and really doesn't give you any help with PHP. If they do not publish a public API for their service (which would be unusual), then using the WSDL as a reference will let you know what objects and methods are accepted by the service and you can plan your method calls accordingly.
The technique you used to call getIssue(...) seems fine, although you should consider using try...catch in case of a SoapException.
I have used Jira SOAP in .NET project and IntelliSense hinted me what fields are available for returned object.
You can use something like VS.Php for Visual Studio or Php for Visual Studio if you are using Visual Studio.
Or you can choose one of the IDEs from here with support of IntelliSense.

Categories

Resources