Hi bloodofeve
The formmail.pl script you are using is now very old.
Why it still keeps cropping up for Perl newbies, no-one knows, (except many web service providers
still keep churning it out), so it isn't your fault you've ended up using it.
FWIW you don't appear to have finished off the 'here' document
at the end of the code snippet you have shown.
In the code you have presented, the only place you set a From: field is in the 'here'
document with the email address, info @ seaviewstudioworkshop.co.uk, in the
body of the email message.
As dsheroh has said, your best option is to use their email in the subject line.
If you think about it, it is quite reasonable for an email server not to appear to send email from
an address it doesn't manage.
You really should also look at some more up-to-date code.
http://learn.perl.org/examples/email_valid.html
Code:
#!/usr/bin/perl
use strict;
use warnings;
use Email::Valid;
my $email_address = 'a.n@example.com';
unless( Email::Valid->address($email_address) ) {
print "Sorry, that email address is not valid!";
}
to check you have a valid email address entered on the form.
and
http://learn.perl.org/examples/email.html
Code:
#!/usr/bin/perl
use strict;
use warnings;
# first, create your message
use Email::MIME;
my $message = Email::MIME->create(
header_str => [
From => 'you@example.com',
To => 'friend@example.com',
Subject => 'Happy birthday!',
],
body_str => 'Happy birthday to you!',
);
# send the message
use Email::Sender::Simple qw(sendmail);
sendmail($message);
to send the email.
The full documentation for the Email::MIME module used can be found at http://search.cpan.org/~rjbs/Email-M.../Email/MIME.pm
You could also look at Mime::Lite http://search.cpan.org/~rjbs/MIME-Li...b/MIME/Lite.pm
Code:
$msg = MIME::Lite->new(
From =>'me@myhost.com',
To =>'you@yourhost.com',
Cc =>'some@other.com, some@more.com',
Subject =>'Hello!',
Data =>"How's it going?"
);
You should be able to install the Perl modules you need via the CPanel interface, if that is what you are using.
Good luck with the website.
Bookmarks