Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 43 lines (30 sloc) 0.912 kB
fbcfdf3 @xsawyerx starting to play with email handling
xsawyerx authored
1 #!/usr/bin/perl
2
3 # TODO:
4 # - use Jemplate
5
6 use strict;
7 use warnings;
8
9 use CGI; # or CGI::Simple ?
10 use Email::Stuff;
11
12 sub error {
13 my $cgi = shift;
14
15 my $return_link_url = $cgi->param('return_link_url') || q{};
16 my $return_link_title = $cgi->param('return_link_title') || q{};
17
18 }
19
20 my $cgi = CGI->new();
21
22 # make sure the form was submitted
23 $cgi->param('submit') || error($cgi);
24
25 my $subject = $cgi->param('subject') || q{};
26 my $name = $cgi->param('realname') || q{};
27 my $email = $cgi->param('email') || q{};
28 my $text = $cgi->param('text') || q{};
29 my $recipient = q{andy@petdance.com}; # this shouldn't be in the form
30 my $from = qq{$name <$email>};
31
32 if ( !$name || !$text ) {
33 # a name and text are essential
34 error($cgi);
35 }
36
37 Email::Stuff->from($from)
38 ->to($recipient)
39 ->text_body($text)
40 ->subject($subject)
41 ->send;
42
Something went wrong with that request. Please try again.