Solved

Sending mail from cgi

Posted on 1997-12-08
7
185 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
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 
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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
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 how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

730 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