Modify the reply-to field when sending manual mail

Hallo,

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):

From: your_name@company.com
Reply-to: your_reply_address@company.com

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. your_name@company.com. So the recipient will see the “From field” as: your_name@company.com. However, if the recipient answers the email I would like this email to be sent to your_reply_address@company.com.

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

Thanks in advance!
Emilio

Dear @emilio.blanco,

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 “noreply@ourdomainname.com”, we looked at this error.

Earlier it used to work that the email would be sent from “noreply@ourdomain.com” but the email when replied to would use “user@ourdomain.com”.
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.

Hello,

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:

Name:
MAIN_MAIL_EMAIL_REPLYTO
Value:
Company name < info@companyname.com >
Note:
Default reply-to address, use format: Naam < info@domein.com > OR: info@domein.com

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

$keyforreplyto = ‘MAIN_MAIL_EMAIL_REPLYTO’;
if($conf->global->$keyforreplyto){
$replyto = $conf->global->$keyforreplyto;
}

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