# [solved] I can't send mails using ssmtp

## javo

Hi all,

I'm tring to send some mail using ssmtp, Since It's my first time I need some advice please

I've emerged ssmtp and edit my configs according to http://www.destr0yr.com/article.php/Gmail_and_sSMTP

when I write ssmtp mymail@gmail.com and write some lines and press ctrl+d nothing happens, what do I do wrong?

Thank youLast edited by javo on Tue Jan 06, 2009 9:51 am; edited 1 time in total

----------

## poly_poly-man

emerge mailx

echo "your message here" | mail -s "your subject" to@whom.com

----------

## javo

thanks, it works

----------

## poly_poly-man

really? that's weird....

well, you were probably doing it wrong before  :Very Happy: 

If this solution is good, add [solved] to your post title with the edit button.

----------

## javo

ok, I'll add it, but I have one more question, 

I wanted to force my php mail() function to send mails via ssmtp, so I edited my php.ini and set my sendmail_path to /usr/sbin/ssmtp

everything worked fine until i restarted my system,

mails can still be easily delivered via command line, but no longer via php

What can possibly go wrong?

thank you

----------

## poly_poly-man

why not just add a symbolic link from sendmail to ssmtp?

----------

## javo

it's little weird that it works with the symlink, and doesn't work with configured php.ini, (althought it worked before)

but it's fine, thx you, solved

----------

## Nitro_146

Hi,

I have a similar problem.

```
mail -s "test" root

mail -s test me@my-isp.fr
```

works well and both send mail to my ISP acount as desired

but

```
ssmtp -s test me@my-isp.fr
```

fails : 

```
  ssmtp: 554 Message refused
```

Also, cron is unable to send me mails :

/var/log/messages : *Quote:*   

> 
> 
> May 22 15:05:28 core2 sSMTP[15549]: killed: timeout on stdin while reading body -- message saved to dead.letter.
> 
> May 22 15:05:28 core2 sSMTP[15549]: Timeout on stdin while reading body

 

Here is my ssmtp.conf

```
#

# /etc/ssmtp.conf -- a config file for sSMTP sendmail.

#

# The person who gets all mail for userids < 1000

# Make this empty to disable rewriting.

root=me@my-isp.fr

# The place where the mail goes. The actual machine name is required

# no MX records are consulted. Commonly mailhosts are named mail.domain.com

# The example will fit if you are in domain.com and your mailhub is so named.

mailhub=smtp.my-isp.fr

# Where will the mail seem to come from?

rewriteDomain=my-isp.fr

# The full hostname

# Gentoo bug #47562

# Commenting the following line will force ssmtp to figure

# out the hostname itself.

# hostname=_HOSTNAME_

hostname=me@my-isp.fr

# Set this to never rewrite the "From:" line (unless not given) and to

# use that address in the "from line" of the envelope.

FromLineOverride=YES

# Use SSL/TLS to send secure messages to server.

#UseTLS=YES

# Use SSL/TLS certificate to authenticate against smtp host.

#UseTLSCert=YES

# Use this RSA certificate.

#TLSCert=/etc/ssl/certs/ssmtp.pem

# Get enhanced (*really* enhanced) debugging information in the logs

# If you want to have debugging of the config file parsing, move this option

# to the top of the config file and uncomment

#Debug=YES

```

----------

