specify the sender's e-mail address for sendmail program

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
noguru
Forum Commoner
Posts: 61
Joined: Thu Jun 06, 2002 4:03 am
Location: Just north of the City Of Gold, Land of Milk and Honey

specify the sender's e-mail address for sendmail program

Post by noguru »

Has anyone worked with the sendmail program before? I'm using a perl script which I got from http://www.pobox.com/~cgires/web2mail/, where you submit everything on an html form to this perlscript and the sendmail program then sends an e-mail to the specified recipient. This recipient's e-mail address is specified using a hidden input tag named ".email_target". The problem is that the "From" address is http@mydomain. I would like to know how to specify my own "From" address. This is critical, because we are using another program here that uses the e-mail address of the sender in the "From" field.

Thanks in advance.
User avatar
bozoo
Forum Newbie
Posts: 1
Joined: Fri Sep 27, 2002 4:44 am

Post by bozoo »

I had a look at that perlscript and what you need to do is to add a line in the &send_mail function just above the "To: $email_address", something like "From: $in{'from_address'} . In your html page you should then have an <input type='text' name='from_address'>. Whatever e-mail address the user types into this field will then be taken as the sender's e-mail address. I tested it on our server and it worked perfectly.
Post Reply