in reply to Help with script using sendmail

Start here: Generic Mail Form Processor.