Changing the Email sender for manual emails

Hello,

I have the following problem: I have one SMTP account for noreply@my-company.com. I would like to use that email address as a sender address, only. The problem is that in the email settings I can choose only between “User Email” and “Company Email” as the sender address by default. When trying to send an email manually, the sender addresses are hard-coded and can not be changed. As I can provide SMTP-authentication to only one SMTP-account, I don’t have the credentials for the “User Email”, nor the “Company Email”.

It’s very silly, because the company email address is put in the invoice - I can not change it there to noreply@my-company.com, because customers, will ask themselves if I’m really serious.

My question is very simple: How can I define a CUSTOM email sender address without using the hard-coded one, OR alternatively: Adding a CUSTOM email sender address to the SMTP settings. Without that possibility Dolibarr seems not really usable to me.

Thank you very much.
pk

1 Like

Hi Rony.
There is a confusion between the email used as the sender and the email/account used for SMTP. This is 2 different things.
The email visible as sender is defined into the setup of company or setup of your user.
For the SMTP, the credentials for authentication (login/pass, often an email/pass) is defined into the home - setup - email - choose SMTP method.
If you really need to have noreply as the visible sender email, just enter this on into the email of your user record so you can use it when sending email.

Merci for your message, Eldy.

I would not agree to that, because the email used as the sender relies on the SMTP email account. How can I use the first without the second? With Dolibarr I can use one SMTP account - but what if the company and each user use different accounts?

I came so far already, I had that idea, yes, but this is inconvinient, because each user needs to use norepy@my-company.com and the second inconvenience is that as the displayed sender name I want to have “MyCompany.com - noreply” (I’m not talking about the email address, but about the String, which gets displayed instead in the email client), but I get the username as the displayed sender name - so the client will receive “John Doe <noreply@my-company.com>” and will think that he can reply to “John Doe”. This can, of course, be circumvented if I change the First- and Lastname of each user to “MyCompany - noreply”, but this is not what I want for obvious reasons.

That’s unfortunately a big shortcoming to me.

P.S.: Each framework and application have an additional field in the SMTP setting where you can define the sender name. Also you could have added the SMTP main account (with it’s sender name) to the (hard-coded) email senders list for manual emails.

Dear Ronny,

Dolibarr use swiftmailer library : https://swiftmailer.symfony.com/docs/sending.html

As you can see you need to define :
The smtp server :

// Create the Transport $transport = (new Swift_SmtpTransport('smtp.example.org', 25)) ->setUsername('your username') ->setPassword('your password')

Then the message with the sender mail :

$message = (new Swift_Message('Wonderful Subject')) ->setFrom(['john@doe.com' => 'John Doe']) ->setTo(['receiver@domain.org', 'other@domain.org' => 'A name']) ->setBody('Here is the message itself')

Hi, thanks for your reply. Sure, with PHP I can do everything. But how to do that in the GUI when sending manual emails from frontend? I’m not sure I understand what you are trying to convey to me.