Linux mail

Posted on 2004-11-25
Last Modified: 2012-05-05

How can I send mail?  I try to write a program to detect some machine, and when there is an error happened, I would like to send can I do so?  Is there any api I can use to send mail through my program??  Help~~~~~

Question by:xenia27
    LVL 38

    Accepted Solution

    You can use mailx, sendmail, mutt (if you installed mutt on your system).

    mailx -s"Subject" < message.txt

    man mailx
    man sendmail
    man mutt
    to learn more details

    if your are writing a shell script the systax is the same as command line, for C use
    system() to run the Linux command (with full path).

    for webpage, do a search for "webmail" or "formmail", eg:

    For sendmail setup, just do a search at EE.

    Author Comment

    so I can call mailx, sendmail, or mutt in my codes??
    LVL 38

    Expert Comment

    Yes, mailx, sendmail comes with the default installation, but "mutt" is an add-on
    package. if you are using mutt, you need to make sure mutt is installed the box to
    run your program, otherwise it will not work!

    Author Comment

    by:xenia27 I got some sense to write the program...thanks~

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
    The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now