# Send mail from command line





### ssmtp

Fichier de configuration:

```bash
nano /etc/ssmtp/ssmtp.conf
```

```bash
UseTTLS=YES
root=bruno@clicclac.info
mailhub=smtp.ovh.net:465
AuthUser=bruno@clicclac.info
AuthPass=xxxxxxxxxxxxxxx
FromLineOverride=YES
```

Email:

```
From: router@clicclac.info
To: bruno@clicclac.info
Subject: Sent from a terminal!

Your content goes here. Lorem ipsum dolor sit amet, consectetur adipisicing.
(Notice the blank space between the subject and the body.)
```

Envoyer l'email:

```bash
ssmtp bruno@clicclac.info < email.txt
```



### msmtp

Fichier de configuration:

```bash
nano ~/.msmtprc
```

```bash
defaults
tls on
tls_starttls off
logfile ~/.msmtp.log

account router
host ssl0.ovh.net
port 465
protocol smtp
from router@clicclac.info
from_full_name DS923
auth on
user router@clicclac.info
#passwordeval gpg --no-tty -q -d ~/.msmtp-password.gpg
password xxxxxxxxxxxxxxxxxxx

account default : router
```

```bash
chmod 600 ~/.msmtprc
```

Email:

```
From: router@clicclac.info
To: bruno@clicclac.info
Subject: Sent from a terminal!

Your content goes here. Lorem ipsum dolor sit amet, consectetur adipisicing.
(Notice the blank space between the subject and the body.)
```

Envoyer l'email:

```bash
msmtp -d -t < email.txt
```

