Add an event to client calendar through an email - java

I have absolutely no idea about how it can be done.
All i have is a mail sending function
sendEmail(List<String> to, String subject, String text)
How can i create an event notification email and forward it to the client, so that client
can add the event to his calendar by clicking an Yes Button

No Javascript is allowed in most of the email clients. So a Button is not helpful to your purpose.
I think the best way is to generate a .ics file and attach it to your email. Most of the email client (like Gmail) can find it and display as a part of email body. Usually, it will has an "add to calendar" link which is generated by email client for this .ics file.
Here is a reference to .ics file format. http://en.wikipedia.org/wiki/ICalendar

Related

Is it possible to get details of the email for which user had replied?

I am using amazon SES to send notification emails in my project. When a user replies back to this email I want to trigger some actions (like a ticket creation or update). Is it possible to know the contents or headers of the email for which user is replying ?
If the replying user's email system supports it (most do), you should receive an In-Reply-To: Header containing the message-id of the email you sent. If you kept that message (along with the message id) you can use this to retrieve original email.
Sometimes the Refereces: Header might be useful as well

User Name in Spring Send Mail API

How to pass the different user name instead of displaying the from email name in mail received to the end user java send mail API.
Atleast you can google first for your question. Anyways refer this.

Add or request a user to add email id to contact list. Is this possible automatically using javamail ?

I have written a java program to send email via SMTP. I would like to know how I can request the user to add my email Id to his address-book/Contact list in his client automatically/manually. Is there a way for me to do it from within my java code. I would like this feature as my emails will not get listed as spam/junk. I am using javamail API.
Thank you,
Nagarajan
NOT POSSIBLE!! You can't do that ,Email will be just mail.Listing your emailid and other things(spam,junk mail) to be done by receiver only.Who receive they have to configure.

Sending HTML formatted email in Android

I have successfully created an Android app that calculates prices and then is able to transfer that data in a preformatted fashion to an email program of the users choice. Depending upon the data the user creates in the app, a string containing the HTML is read into an intent. The code I have for this is:
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("text/html");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(emailText));
QuoteDroid.this.startActivity(emailIntent);
This is all fine and the email is mostly formated correct when I choose the Gmail app, and generally sends mostly correct. The issue I have with this is that I must send it from a non-gmail account for business purposes. When I choose the generic email app on the phone it does not process the HTML properly and when I send the email it is formated in plain text.
I've read through countless articles and forum posts, but to no avail. How do I process the string, containing the HTML, in such a way that the email -after being sent with the built in email app- is viewed properly formated by the receiver?
It's up to the individual mail app to properly handle the String that it receives as the EXTRA_TEXT. A well-behaved mail app will see the mimetype and handle the EXTRA_TEXT appropriately, but not all mail apps do.

How can I send two emails via javamail such that outlook will put them in the same conversation?

At some point, I've sent an email and it is processed and received by an exchange server and then viewed by an outlook client. At a later point, I send another email where it is a reply/related to the 1st email. I want outlook to know that they are related and group them together when I group emails by conversation.
A couple of caveats:
I won't have access to the 1st email's message object to reply off of.
I will have the subject, messageID, and body of the first email when composing the 2nd email.
I've tried adding the "in-reply-to" and "references" header fields in the 2nd email, but outlook will not conversate them. Thunderbird and Gmail will thread them appropriately, though.
When grouping messages into a Conversation, Outlook will most likely not use the header fields but rather the subject line. It will ignore words like Fw: and Re:.
Try prepend a Re: to the first message subject and use this as second message subject.
Ref: http://lifehacker.com/157042/make-outlook-thread-conversations-like-gmail

Categories