Find the answer to your Linux question:
Results 1 to 7 of 7
Okay... so as you may have noticed from my previous messages... I'm pretty new at the whole BASH world and Linux world... but I like it and want to know ...
  1. #1
    Just Joined!
    Join Date
    Apr 2008
    Posts
    18

    Bash & Mail

    Okay... so as you may have noticed from my previous messages... I'm pretty new at the whole BASH world and Linux world... but I like it and want to know more. Here's my newest question/objective.

    How do I mail from Bash. For example...

    I have a variable... $happyday

    $happyday is influenced by factors and then periodically tested.

    If $happyday comes back true, I want to send an email to myself via my POP3 Gmail account telling me that all is well.

    How do I 1) configure Linux to use my POP3 account at this level and 2) write BASH code that will carry out this task?

    Thanks!

    Mark Smith

  2. #2
    Linux Newbie
    Join Date
    Jul 2008
    Posts
    181
    Since this is the programming forum, I will focus on your second question.

    Code:
    mail -s "All is well" MarkTSmith78@gmail.com

  3. #3
    Just Joined!
    Join Date
    Apr 2008
    Posts
    18
    suseTestBox:/home/administrator/Desktop # mail -s "All is well" MarkTSmith78@gmail.com

    It seems to be stalling out when I use this command... probably due to my other question of getting setup correctly for this usage? If so, what's the best forum for that?

    Mark Smith

  4. #4
    Linux Newbie
    Join Date
    Jul 2008
    Posts
    181
    That would depend on your distribution and your choice of MUA and/or MTA.

  5. #5
    Linux User
    Join Date
    Jun 2007
    Posts
    318
    Quote Originally Posted by MarkTSmith78@gmail.com View Post
    suseTestBox:/home/administrator/Desktop # mail -s "All is well" MarkTSmith78@gmail.com

    It seems to be stalling out when I use this command... probably due to my other question of getting setup correctly for this usage? If so, what's the best forum for that?

    Mark Smith
    It's probably stalling out because it's waiting for you to type in the text of the message followed by the ^d. Try this:

    Code:
    mail -s "All is well" MarkTSmith78@gmail.com << ++EOT++
    ++EOT++

  6. #6
    Just Joined!
    Join Date
    Apr 2008
    Posts
    18
    Quote Originally Posted by burschik View Post
    That would depend on your distribution and your choice of MUA and/or MTA.
    openSuse 10.3.

    MUA and/or MTA... what? Sorry, no idea.

    Mark

  7. #7
    Linux Newbie
    Join Date
    Jul 2008
    Posts
    181
    MUA = Mail User Agent (e.g. MS Outlook), MTA = Mail Transfer Agent (e.g. Postfix).

Posting Permissions

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