Sorry, didn't read that second line properly about attachments properly. What error do you get when buildling kservice? You may find this tool that builds dependencies useful: https://inqlude.org.
Alternatively, you can probably just extract this one invokeMailer here: https://api.kde.org/frameworks/kservice/html/ktoolinvocation__win_8cpp_source.html It appears KToolInvocation doesn't have an OS X backend. David