I'm having problems writing a mail merge program that produces
e-mail messages. I'm using the "com.sun.star.text.MailMerge" service,
coding in Java.
How can I tell MailMerge details about my mail server such as its
address, port, protocol (e.g. SSL), and my user name?
MailMerge does have a "OutServerPassword" property for
supplying the server's password, but nothing for the other
bits of information.
Some partial code (using some of my support classes):
Code: Select all
XJob job = Lo.createInstanceMCF(XJob.class, "com.sun.star.text.MailMerge");
XPropertySet props = Lo.qi(XPropertySet.class, job);
props.setPropertyValue("DataSourceName", DATA_SOURCE_NAME);
props.setPropertyValue("Command", TABLE_NAME);
props.setPropertyValue("CommandType", CommandType.TABLE);
props.setPropertyValue("DocumentURL", FileIO.fnmToURL(TEMPLATE_FNM));
props.setPropertyValue("OutputType", MailMergeType.MAIL);
props.setPropertyValue("OutServerPassword", "XXXX");
props.setPropertyValue("AddressFromColumn", "E-mail");
props.setPropertyValue("Subject", "Hello from Andrew ");
props.setPropertyValue("MailBody", "Please read the attached message.");
props.setPropertyValue("SendAsAttachment", true);
props.setPropertyValue("AttachmentName", "GS-Thanks.pdf");
props.setPropertyValue("AttachmentFilter", "writer_pdf_Export");
job.execute(new NamedValue[0]);
to send e-mail using the com.sun.star.mail.MailServiceProvider service
directly.
A solution in any language would be much appreciated.
- Andrew