Solved

Sending mail from cgi

Posted on 1997-12-08
7
181 Views
Last Modified: 2013-12-25
How do I send a mail from a (ANSI C) cgi program? I don't want the user to interfere. The mail should be entirely automatic. Maybe I have to do this through a JavaScript?
0
Comment
Question by:obg
7 Comments
 
LVL 7

Expert Comment

by:faster
ID: 1831580
A CGI right?  You need only download a perl script to do that.  "Formmail" or something else will do.


0
 
LVL 2

Author Comment

by:obg
ID: 1831581
Sorry! I have to use ANSI C. If that can't be done, I have to use some JavaScript, or such.
0
 
LVL 7

Expert Comment

by:faster
ID: 1831582
what platform?
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 2

Author Comment

by:obg
ID: 1831583
I use a unix platform, but I would like the solution to be as portable as possible. I realize that I can use the system("mail") function, but who will be the sender? - Guess I'll have to try...
0
 

Accepted Solution

by:
mikal120797 earned 100 total points
ID: 1831584
Ok. This works on Linux, I assume it is standard. If this sample below doesn't work play with it -- it should work fine. Oh, and to use rmail you need to be running sendmail.

Call system("rmail recipient < filename_to_be_sent");

The first line of the file to be sent should read:
From user_who_sent_it

NOTE: No colon...
0
 

Expert Comment

by:kennethm
ID: 1831585
if you use "mail recipient < filename_to_be_sent", the sender will be the http daemon of your web server.

You can also use "mailx -r recipient -s subject < filename_to_be_sent"

"Sendmail" also performs simliar options.
0
 
LVL 2

Author Comment

by:obg
ID: 1831586
I know the sender will be the http deamon, but I can change the sender, as mikal said, using From... I can still see, however, that the mail comes from the deamon. What is the difference in this aspect between rmail and mailx?
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

777 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