I want to send an email to various recipients with command line. I'm using the stmp server from my email providers and msmtp is the smtp client (on linux). The command I use is:
mail -s 'mysubject bla bla' dest1@free.fr -c dest2@club-internet.fr <<< 'Hello'
and I have the error message:
send-mail: l'adresse de destinataire -c n'est pas acceptée par le serveur
send-mail: message du serveur : 504 5.5.2 <-c>: Recipient address rejected: need fully-qualified address
send-mail: le courriel n'a pas pu être envoyé (compte default dans /home/user/.msmtprc)
Here is my .msmtprc config:
# Set default values for all following accounts.
defaults
auth on
tls on
tls_trust_file /etc/ssl/certs/ca-bundle.crt
logfile ~/.msmtp.log
account myaccount
host smtp.free.fr
port 465
from myaccount@free.fr
user myaccount@free.fr
password xxxxxxx
tls_starttls off
tls_certcheck on
# Set a default account
account default : myaccount
It works fine if I don't specify -b or -c recipient, but if I add one of these, I have the error message. I tried with several recipient email addresses on different domains and it's the same. Thanks