# ssmtp: login to send mail

## DumbAss

Hi!

Ok, the goal I want to achieve is to send mail via the command line with the command "mail".

I've edited /etc/ssmtp/ssmtp.conf so it matched my exchange server. The only problem is that I have to login in the exchange server to send mail.

With the command:

```

ssmtp -au user -ap password -am CRAM-MD5 someone@google.com

```

I can send mail with this command but I want to be able to send mail with the command "mail".

How can I achieve this?

----------

## punzeroni

Hi DumbAss! 

(what a wonderful nickname you chose! )

My suggestion would be to create a link to the binary of ssmtp (i reckon it should be /usr/sbin/ssmtp).

```

ln -s /usr/sbin/ssmtp /usr/sbin/mail

```

In case you also want to get rid of the "lengthy" command you could go take another approach -> shell script

in /usr/sbin create a file called mail.sh which contains the following lines:

```

#!/bin/sh

ssmtp -au user -ap password -am CRAM-MD5 $1

```

then you create a link to it:

```

ln -s /usr/sbin/mail.sh /usr/sbin/mail

```

and if I think correctly you're now able to send mails with 

```

mail dumbass@nickname.nl

```

Hope that helped

----------

