Stephan Bergmann wrote:
Peter Eberlein wrote:
Hi,
I stumbled over Services, which (so I guess) have to be created with
the ServiceManager.createInstanceWithArguments(AndContext)() method.
for example:
http://api.openoffice.org/docs/common/ref/com/sun/star/mail/MailMessage.html
So the following should work:
Object[] args = new Object[4];
args[0] = "[EMAIL PROTECTED]";
args[1] = "[EMAIL PROTECTED]";
args[2] = "Subject";
args[3] = new TextTransferable("Body");// a helper class from the
SDK\examples\DevelopersGuide\OfficeDev\Clipboard, which implements
the XTransferable interface
XMailMessage xMailMessage = (XMailMessage)
UnoRuntime.queryInterface(XMailMessage.class,
xMultiComponentFactory.createInstanceWithArgumentsAndContext("com.sun.star.mail.MailMessage",args,xComponentContext));
The created object is null.
Any ideas?
Assuming your code is in Java, then
XMailMessage xMailMessage = com.sun.star.mail.MailMessage.create(
xComponentContext, "[EMAIL PROTECTED]", "[EMAIL PROTECTED]",
"Subject", new TextTransferable("Body"));
would be the right way to do it. (However, I have no idea why
xMailMessage is null for you.)
Is using OO for sending Email with a textbody still a forbidden fruit ?
"com.sun.star.system.SimpleCommandMail"
and "com.sun.star.system.SimpleSystemMail" do not acept a body either
Can someone explain why emailing with OO if Forbidden ?
Fernand
-Stephan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]