OK,
in the mean time i found some basic stuff who can do the job.
It looks ugly: but it works and the content is "formated as in the
Writerdoc"
Copy the Body content from a opened Writerdoc, then use this content
from the clpiboard to send the Email
Sub Main
oMailProvider = CreateUNOService("com.sun.star.mail.MailServiceProvider")
oCont = CreateUNOListener("CurCont_","com.sun.star.uno.XCurrentContext")
oAuth = CreateUNOListener("Authent_","com.sun.star.mail.XAuthenticator")
copydoccontentToClipboard
oClip =
CreateUnoService("com.sun.star.datatransfer.clipboard.SystemClipboard")
oMailServiceObj = com.sun.star.mail.MailMessage
rem
http://api.openoffice.org/docs/common/ref/com/sun/star/mail/MailMessage.html
rem Use the contents of the clipboard as the content of the email
oMail = oMailServiceObj.create( "[email protected]", "[email protected]",
"SUBJECT",oClip.getContents())
xMailServer = oMailProvider.Create("com.sun.star.mail.SMTP")
xMailServer.Connect(oCont,oAuth)
msgbox xMailServer.isConnected
xMailServer.SendMailMessage(oMail)
xMailServer.Disconnect()
End Sub
Function CurCont_GetValueByName(s) as Any
Select Case s
Case "ServerName"
CurCont_GetValueByName = "mail.pmgroup.be"
Case "Port"
CurCont_GetValueByName = 25
Case "ConnectionType"
CurCont_GetValueByName = "Insecure"
End Select
End Function
Function Authent_GetUserName() as Any
Authent_GetUserName = "[email protected]"
End Function
Function Authent_GetPassword()
Authent_GetPassword = "mypassword"
End Function
sub copydoccontentToClipboard
dim document as object
dim dispatcher as object
dim oDoc, oVC
oVC = ThisComponent.CurrentController.getViewCursor
oVC.gotostart(false)
oVC.gotoEND(true)
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(ThisComponent.CurrentController.Frame,
".uno:Copy", "", 0, Array())
end sub
--
Unsubscribe instructions: E-mail to [email protected]
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.documentfoundation.org/www/discuss/
All messages sent to this list will be publicly archived and cannot be deleted