-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmail.cgi
More file actions
59 lines (44 loc) · 1.37 KB
/
mail.cgi
File metadata and controls
59 lines (44 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/perl -w
# little cgi for sending an email. test proggy for use with v3.com.
# esteban wainsteado, para ampira.com, 30 deciembre 2002
# $Id: mail.cgi,v 1.3 2003/01/08 16:04:04 swain Exp $
use strict;
use Mail::Sendmail;
use CGI qw/:standard/;
print "Content-type: text/html\n\n";
my $email = 0;
my $message = "Write a message here";
my ($subject, $to, $from);
if (param()) {
$email = 1;
$message = param('message') ? param('message') : "Write a message here";
$subject = param('subject') ? param('subject') : "Hello, sailor!";
$to = param('to') ? param('to') : "swain\@ampira.com";
$from = param('from') ? param('from') : "test message <swain\@ampira.com>";
}
print <<"EOLN" unless $email;
<html>
<head>
<title>little mail sender</title>
</head>
<body>
<form name="email form" method="POST">
<input type="text" name="to" value="$to">:To<br>
<input type="text" name="subject" value="$subject">:From<br>
<textarea name="message">
$message
</textarea>
<br>
<input type="submit" value="send">
</form>
</body>
</html>
EOLN
my %mail = ( To => $to,
From => $from,
Subject => $subject,
Message => $message,
smtp => 'ims-1.corp.ampira.com'
);
sendmail(%mail) or print "<h3>$Mail::Sendmail::error</h3>\n";
print "<pre>OK. Log says:\n", $Mail::Sendmail::log;