« March 2005 »
S M T W T F S
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

You are not logged in. Log in
Open Community
Post to this Blog

Helpful Links
Angelfire Home
Register Your Domain
Angelfire's Twitter
Angelfire's Facebook

Angelfire Club Blog
Need assistance and ideas from fellow Angelfire members to help build and manage your website? You've come to the right place!
To join this Community Blog, you must be an Angelfire member. Just click the "Join this Community" link, and start posting immediately.

Hint: When posting, select a topic that most relates to your question. (News, FrontPage, HTML Questions, etc...) This will help to keep the blog organized for everyone.

View Latest Entries

Thursday, 24 March 2005
Frustrated with sendmail
Mood:  not sure
I'm confused with the angelfiremail sendmail program. Could anyone email me on what to substitute in different keys($) of the sendmail program. i.e. $class,$self,$message. And this line###..$MAIL->sendMail ($mail_template,\%variables);..### Do I place the name of my mail template file in the key $mail_template and do I put my variables in the %variables hash? Email me at Reekerave@hotmail.com with your help. require AngelfireMail; $MAIL = new AngelfireMail; $mail_template = "./flintstones_mail.txt"; %variables = ('email' => 'Wilma@gurlmail.com', 'name' => 'Wilma', 'number' => '2'); $MAIL->sendMail($mail_template, \%variables); sub new { my $class = shift; my $self = {}; bless $self, $class; return $self; } sub sendMail { # example: $MAIL->sendMail($template_file, \%hash_o_variables) # requires: 1) name of a file that is a template for the mail # 2) a reference to hash of variables to fill out the template # does: writes a mail file to member's directory to be mailed later # by sendmail # returns: 1 on success, 0 on failure my ($self, $template_file, $hash_ref) = @_; my ($message, $key, $time, $file); # error checking if ((! $template_file)||(! $hash_ref)){ print STDERR "usage: sendMail(template_file, hash_reference)\n"; return 0; } if (! -s $template_file){ print STDERR "file does not exist or has a 0 size!\n"; return 0; } # read in template open (MESSAGE, "<$template_file") or die "can't open template file $template for reading\n"; undef $/; $message = ; close (MESSAGE); $/ = "\n"; # variable substitution foreach $key (keys (%{$hash_ref})){ $message =~ s/\$$key/$hash_ref->{$key}/eg; } # check final template format if ($message !~ /to:.*\w+@\w+\.\w+/i){ print STDERR "To: field missing or invalid recipient\n"; return 0; } if ($message !~ /from:.*\w+@\w+\.\w+/i){ print STDERR "From: field missing or invalid sender\n"; return 0; } # write template to file $time = time(); $file = 'mail.'.$time; open (FILE, ">$file") or die "can't open file: $file for writing\n"; print FILE $message; close (FILE); return 1; } 1;


Posted by jazz/e_iray at 4:41 PM EST | Post Comment | View Comments (1) | Permalink | Share This Post

Thursday, 24 March 2005 - 7:08 PM EST

Name: dalleh
Home Page: https://www.angelfire.lycos.com/build/scriptlib/form.tmp

do you need a mail form? if yes try this one
https://www.angelfire.lycos.com/build/scriptlib/form.tmpl

View Latest Entries