i am building an application (in c++) which is supposed to take params (Subject,From,To,Content,Attachment path) from 3rd party app, compose an email and then save it to Drafts under particular account. I dont know what tools should i use for it exactly. I can connect to zimbra through ssh socket and execute commands. I can upload a file to server using sftp. I have found some usefull commands like addmessage or /postfix/sendmail. But i dont know how compose a new message and connect an attachment to it in command line.

Should i approach to this app in other way?

Thank for any advice.