Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm new to raspberry pi.

I installed the raspian OS on it. I want to send emails from it using my gmail account. I want to send from the command line interface and from php scripts.

I followed this guide. http://iqjar.com/jar/sending-emails-from-the-raspberry-pi/

I did steps 1,2,3,4 from the link.

When I send an email using the code below using

echo "Test text" | mail -s "Test Mail" me2@gmail.com

nothing happens, there is nothing printed on the screen, and I don't get the email.

On "revaliases", if I replace "mail.google" with "smtp.gmail", then I get back a message saying

send-mail: Cannot open mail.google.com:587

or

send-mail: Server didn't like our AUTH LOGIN (530 5.7.0 Must issue a STARTTLS command first. ml2sm3592928igb.10 - gsmtp)

How can I fix this?

Here are the two files below:

ssmtp.conf

#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
# root=postmaster

# The place where the mail goes. The actual machine name is required no 
# MX records are consulted. Commonly mailhosts are named mail.domain.com
# mailhub=mail

# Where will the mail seem to come from?
#rewriteDomain=

# The full hostname
hostname=raspberrypi

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES


root=me@gmail.com
mailhub=smtp.gmail.com:587
AuthUser=me@gmail.com
AuthPass=mypass
UseSTARTTLS=YES

revaliases

# sSMTP aliases
# 
# Format:   local_account:outgoing_address:mailhub
#
# Example: root:your_login@your.domain:mailhub.your.domain[:port]
# where [:port] is an optional port number that defaults to 25.

root:me@gmail.com:mail.google.com:587
share|improve this question
    
Gmail is probably delivering the messages to your Spam folder. –  jasonwryan Dec 21 '13 at 0:15
    
I looked in the junk folder, but none of them are there... –  omega Dec 21 '13 at 0:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.