Results 1 to 7 of 7

Thread: HOWTO guide to use and set up sendemail

  1. #1
    Join Date
    Feb 2007
    Location
    US of A
    Beans
    639
    Distro
    Ubuntu Karmic Koala (testing)

    HOWTO guide to use and set up sendemail

    In case you do not know you can send email messages from the terminal to any email address or user. I find it to be particularly useful to send emails to myself after my computer completes automated tasks.

    One such task is when I used a cron command to backup my computer weekly. It is important to me to know this was done successfully without having to dig through log files.

    Here is how to setup sendemail ...

    First

    Code:
    sudo apt-get install sendemail
    Code:
    sudo apt-get install libio-socket-ssl-perl
    These two commands get all the needed files from the repositories and installs them. Now to actually send a message.

    Code:
    sendEmail -f username@foo.com -t destination@foo.com -cc carboncopy@foo.com -u "Message title" -m "The body of the message" -s smtp.foo.com:25 -xu username -xp password
    This will work with a variety of smtp hosts including gmail. To use gmail change the last line to this ...

    Code:
    sendEmail -f username@foo.com -t destination@foo.com -u "Message title" -m "The body of the message" -s smtp.gmail.com:25 -xu username -xp password

    thanks to 'lovinglinux' for helping me with this
    If you have any questions just send me a private message and a link back to the thread
    My Guides: sendEmail | Windows Shares

  2. #2
    Join Date
    Aug 2008
    Location
    Brazil
    Beans
    12,497
    Distro
    Ubuntu Studio 12.04 Precise Pangolin

    Re: HOWTO guide to use and set up sendemail

    Quote Originally Posted by steve101101 View Post
    thanks to 'lovinglinux' for helping me with this
    You are welcome. SendEmail is great if you want a simple method of sending messages through cli without messing with MTA and mail servers.

  3. #3
    Join Date
    Feb 2007
    Location
    US of A
    Beans
    639
    Distro
    Ubuntu Karmic Koala (testing)

    Re: HOWTO guide to use and set up sendemail

    yes it is. Its great.
    If you have any questions just send me a private message and a link back to the thread
    My Guides: sendEmail | Windows Shares

  4. #4
    Join Date
    Nov 2009
    Beans
    20

    Question Re: HOWTO guide to use and set up sendemail

    I'm trying to use sendEmail to mail me virus scan report from an ftp server. But it fails to send the mail if the scan takes too long. I try:
    Code:
    $ sudo clamscan <clamscan options> | sendEmail -f <my mail on server> -t <my email> -u "Virus Report" -s <my isp's smtp>
    I get:
    Code:
    Reading message body from STDIN because the '-m' option was not used.
    If you are manually typing in a message:
      - First line must be received within 60 seconds.
      - End manual input with a CTRL-D on its own line.
    
    Dec 15 03:53:52 <hostname> sendEmail[8906]: EXITING: Received SIGALRM
    a simple echo or a short scan will send just fine

    How can i disable this timelimit?

    EDIT: my bad, i just found the "-o timeout=" option
    Last edited by Zyprexa; December 15th, 2009 at 04:14 AM. Reason: [SOLVED]

  5. #5
    Join Date
    Feb 2007
    Location
    US of A
    Beans
    639
    Distro
    Ubuntu Karmic Koala (testing)

    Re: HOWTO guide to use and set up sendemail

    glad you found the option.
    If you have any questions just send me a private message and a link back to the thread
    My Guides: sendEmail | Windows Shares

  6. #6
    Join Date
    Feb 2013
    Beans
    2

    Question Re: HOWTO guide to use and set up sendemail

    I am a newbie and have a few questions.

    If I send an email through my gmail account I get the following error message:

    Code:
    server sendmail [15257]: ERROR => ERROR => SMTP-AUTH: Authentication to smtp.gmail.com: 25 failed.
    How do I send an e-mail:

    Code:
    sendEmail -f username@foo.com -t destination@foo.com -u "Message title" -m "The body of the message" -s smtp.gmail.com:25 -xu username -xp password
    Should I replace username@foo.com with my own email address and destination@foo.com with that of the recipient?

    And what do I fill in at: -xu username and -xp password? My gmail account details or something else? Can someone give an example, thanks!

    Sorry, for my bad English.

  7. #7
    Join Date
    Jul 2008
    Location
    The Left Coast of the USA
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: HOWTO guide to use and set up sendemail

    Thank you for sharing. Everyone’s questions and answers are valuable.

    But if a thread has had no activity for about a year or more, it is best to start a new thread of your own because you will be more likely to get a response.

    Please feel free to add a link to this thread in the new one you start.

    Thread closed.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •