mybluegrass
asked on
Launch outlook with pre-populated fields and attachments in java
Is it possible to launch outlook with some fields pre-populated (from, to, subject) and attachments attached to the email inside a java application?
Thanks!
Thanks!
You can use JavaMail to send email and can do attachements list of addresse, etc.
And you can make a simple application wehe people cn modify or edit the email before sending
If your purpiose is to send email JavaMai is every convenient.
No doubt you can launch outlook from Java but this will be much bigger overhead and less flexible in many senses
And you can make a simple application wehe people cn modify or edit the email before sending
If your purpiose is to send email JavaMai is every convenient.
No doubt you can launch outlook from Java but this will be much bigger overhead and less flexible in many senses
ASKER
I have already used javamail to send email inside my servlet. But I also need to launch outlook so users can use their outlook address book, signature, etc. Thanks!
Well, then you can use Runtime.getRuntime().exec. .. to start it, but do you want it to come
up with some particular screen say sending email?
up with some particular screen say sending email?
You can start it wioth switches as specified on this page (click on switch reference)
http://office.microsoft.com/en-us/outlook-help/command-line-switches-HP001003110.aspx
There are lots of options there
ASKER
Will Runtime.getRuntime().exec allow me to pre-populate some fields and attach files sent from server? The mailto function can pre-populate some fields but just not attachments. I'm afraid it's a security issue and not even possible. Thanks!
Check these switches - maybe you are right - maybe no attachements there, but a lot of
options.
The other thing to consider, that most of the users may alreday have Outlook opened,
so there may be some issues with that.
In general, if possible, I'd rather avoid such situation.
If you knoe already a lot about their message, then use JavaMail,
otherwise, maybe you would just offer them to send themselves through outlook.
This intermediate suituation is possible, but when you start getting into details
may have some clashes and inconveniences and some differences on dofferent desktops, etc.
That's at least my opinion.
options.
The other thing to consider, that most of the users may alreday have Outlook opened,
so there may be some issues with that.
In general, if possible, I'd rather avoid such situation.
If you knoe already a lot about their message, then use JavaMail,
otherwise, maybe you would just offer them to send themselves through outlook.
This intermediate suituation is possible, but when you start getting into details
may have some clashes and inconveniences and some differences on dofferent desktops, etc.
That's at least my opinion.
In general Runtime.getRuntime().exec should of course accept switches, etc. everything what command line accepts
> Is it possible to launch outlook with some fields pre-populated (from, to, subject) and attachments attached to the email inside a java application?
afaik its not possible
afaik its not possible
ASKER
I see that the switches allow me to attach a file, but I didn't see a switch to allow me to include to, cc or subject field. Thanks!
ASKER
Never mind. Found the solution here:
http://stackoverflow.com/questions/248569/starting-outlook-and-having-an-email-pre-populated-from-command-line
Just have to add
/m name@email.com&cc=name2@em ail.com&su bject=test %20subject
http://stackoverflow.com/questions/248569/starting-outlook-and-having-an-email-pre-populated-from-command-line
Just have to add
/m name@email.com&cc=name2@em
Great!
ASKER
Is there a way to attach multiple attachments using switch /a?
Thanks!
Thanks!
I don't know but you can try with different syntax
/a oneFile /a twoFile
or maybe
/a oneFile,twoFile
just try
/a oneFile /a twoFile
or maybe
/a oneFile,twoFile
just try
ASKER
I've tried different variations including what you've suggested. But none works. I'm wondering that it's possible or not. Thanks!
ASKER
It seems that it's not possible to attache multiple attachments using the switch:
http://www.pcreview.co.uk/forums/do-launch-outlook-multi-attachments-using-command-line-t2343640.html
Has anyone done this before? If not, what will be the alternative?
Thanks!
http://www.pcreview.co.uk/forums/do-launch-outlook-multi-attachments-using-command-line-t2343640.html
Has anyone done this before? If not, what will be the alternative?
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Do you really want to lauvnch outlook or you want to send an email
form java appalications?
If so JavaMail is the best way to dio it