Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 185
  • Last Modified:

Linux mail

Hi,


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 mail...how can I do so?  Is there any api I can use to send mail through my program??  Help~~~~~



Xenia
0
xenia27
Asked:
xenia27
  • 2
  • 2
1 Solution
 
yuzhCommented:
You can use mailx, sendmail, mutt (if you installed mutt on your system).

eg:
mailx -s"Subject" some@domain.com < 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:
http://www.discountdomainsuk.com/articles/9/345/0

For sendmail setup, just do a search at EE.
0
 
xenia27Author Commented:
so I can call mailx, sendmail, or mutt in my codes??
0
 
yuzhCommented:
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!
0
 
xenia27Author Commented:
OK...now I got some sense to write the program...thanks~
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now