Open E-Mail Client from Samba

Is there any method of opening an email client from Sambapos like Outlook for example.
Currently there is no real method of applying any formatting to emails and sent emails are not being stored in the sent folder. And also it would be great to be able to attach a pdf copy of a receipt.

Start process action would start an email client using its .exe but wouldnt help you format an email sent by samba as it in essence acts as its own client (just SMTP/sending)

Stop using POP then LOL
If its IMAP serer sent should be synced between all clients.

Sure there is an attachment field? You would need to create PDF and set directory - most likely using script.

Email formatting would be done with HTML. have you tried using HTML code in the body?

1 Like

Emails send from sambapos are sent via SMTP. It is up to the email client itself to push the email to the sent folder on the server.

Gmail does store the sent items but self hosted email servers do not. (I have tried multiple)

Yes I understand that and have it working. What I was suggesting is that pushing a file to an external email client would be requirement is this could be added to sambapos.

Yes I have but the emails are sent as plain text. I have tried using samba tags such as \r <linebreak/>

\r works if it is added by way of a ?Prompt but it is not an ideal solution to have a question popping up every time.

That’s why I was requesting the ability to push the email and let something like outlook handle formatting etc.like
Quickbooks does for example,

I don’t think it was meant to be a full featured email client. Mostly for sending simple emails. With scripting we can probably do something. There is a full featured outlook api for example.

It will be different for each client I expect.

Using Script, you can probably hook Outlook libraries/assemblies and send an Email without even opening the EXE.

There might be other options with Outlook.exe such as command-line parameters… have you looked into that? The Start Process might work.

Either way, need to do some research about sending mail with Outlook. If your Client is different, then the options will be different.


You shouldn’t need a prompt to make that work.

And there should be nothing stopping you from sending a full HTML mark up as the body of the email if you construct it properly.


Are you talking about the EXE or the COM? Or both? :wink:

That’s why I was asking if there currently is (or possibly could be added) a method of letting a dedicated email client handle sending emails.

Surely an email printer type or something similar would be a posible plan?
HTML print template with tags for dynamic content?

Which Client? They are all going to be different in the methods to interact with them. That’s the problem.

Windows mail would probably be the best since anyone running samba would already have it. Or possibly even something opensource like thunderbird.

Outlook 365 and outlook.com has a rest api. That might be the quickest solution.

#Script

Name: Email
Handler: email
Script:

function format(message) {
	message = typeof message!=='undefined' ?  message : '';
	
	message = message.replace(/\r/g,"\r");
	
	return message;
}

#Rule with {CALL:X}

message:

{CALL:email.format('this is my message\rand this is on a new line\rso is this')}

#Result


P.S. I tried sending a fully-formatted HTML document, but it does not work. It simply looks like this (plain text):


P.P.S. I will try a script to see if it is possible to hook Outlook.EXE assemblies, but it will need to wait for a bit … I suspended my account testing the above LOL …

4 Likes

Looks doable …


That’s because the MIME type of the email needs to be changed to HTML. You won’t be able to access the email headers currently in SambaPOS. Possibly that could be added as an advanced option, or at least an email format HTML / Plain Text selection?

2 Likes