Hi,

I would like to use the subject module for mailing, because com.sun.star.system.SimpleSystemMail has some restrictions (no access to body).

I can connect to SMTP (thanks to ms777) with the following snippet, but found no way to instanciate a com.sun.star.mail.MailMessage (CreateUNOService("com.sun.star.mail.MailMessage") gives me a null-object).

Any hints?

Regards

Peter


Sub MailService()

oMailProvider = CreateUNOService("com.sun.star.mail.MailServiceProvider")

  oCont = CreateUNOListener("CurCont_","com.sun.star.uno.XCurrentContext")
  oAuth = CreateUNOListener("Authent_","com.sun.star.mail.XAuthenticator")
  xMailServer = oMailProvider.Create("com.sun.star.mail.SMTP")

  xMailServer.Connect(oCont,oAuth)
  msgbox xMailServer.isConnected

  xMailServer.Disconnect()

End Sub

Function CurCont_GetValueByName(s) as Any

  Select Case s
   Case "ServerName"
    CurCont_GetValueByName = "MailServer"
   Case "Port"
    CurCont_GetValueByName = 25
   Case "ConnectionType"
    CurCont_GetValueByName = "Insecure"
  End Select

End Function

Function Authent_GetUserName() as Any
  Authent_GetUserName = ""
End Function

Function Authent_GetPassword()
  Authent_GetPassword = ""
End Function

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to