?
Solved

Sending mail from cgi

Posted on 1997-12-08
7
Medium Priority
?
193 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
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 300 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

762 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