Modify the reply-to field when sending manual mail


I would like to modify the field “Reply-to” when an user send an email from from Dolibarr. I am not using php as the sending method but Swift Mailer socket library to connect Dolibar with my SMTP server.

I would like to set-up the following configuration for every internal users (different for each one):


When creating an internal user it is possible to define the user’s email from the Graphical User Interface of Dolibarr. I would like to set-up the real email account for the user in this field so all emails sent by Dolibarr have the correct “From field”, i.e. So the recipient will see the “From field” as: However, if the recipient answers the email I would like this email to be sent to

I would appreciate if you tell me how to handle this functionality.

Thanks in advance!


Any updates on the above or how you achieved it?
We want to use something similar but are unable to find any solutions.
It worked okay earlier but is now not working as expected.

Any help would be appreciated.

Paging @eldy for your intervention.
I thought this was the default behavior or atleast it was for a while.
Someone pointed that the reply emails were going to “”, we looked at this error.

Earlier it used to work that the email would be sent from “” but the email when replied to would use “”.
Now that is not the case and our manual emailing has been stopped which is difficult for us to handle.

Please share anyways for this to work. what settings did I mess up if any? I cannot seem to figure out what went wrong and when.

Sorry to bring you onto this, but this is critical to our business processes.

When you send an email from inteeface, the reply is done on the same email than the email used to send email. If email is send by a batch process automatically, it is on the email defined into setup. If not defined, it will be same email than email used for sender (also defined into setup).
With v12 orb+, you can create as many sender profile (with different sender emails) as you want. But warning, if the email is not a valid email for your email provider, your email provider will replace it himself with another valid email. So check that your setup in Dolibarr uses only email that are allowed by email provider.


I have made a custom Setup Other setting for this issue earlier this year. It needs some scripting and I can make an offer for you if you like. A customer of mine had the same issue. It looks like this:

Company name < >
Default reply-to address, use format: Naam < > OR:

If you want or can do it yourself, you need at least add the following: in htdocs/core/

$keyforreplyto = ‘MAIN_MAIL_EMAIL_REPLYTO’;
$replyto = $conf->global->$keyforreplyto;

$mailfile = new CMailFile($subject, $sendto, $from, $message, …, $replyto);