Form handling code stopped working due to PHP upgrade

OK, the hosting company was able to help me somewhat. At least it generated an email but they editted my php file to what it shows below. And now my problem is that the email generated shows from [email protected]. Ideally, I need it to read where our customers put in their account name. But if that won’t work, I need it to show from the email address that they input.

edit: Whoops! I gave it a shot and got it fixed. Working good now. Thanks everyone for their help and especially Q1712 for sticking with me!!! :smiley:

Just in case someone else runs into this, here is the code that made the difference:

[code]<?php

$title = “Submit your Meter Readings”;
$home = “http://www.oursite.net”;
$mailto = "[email protected]";
$number = " Your IP is $_SERVER[REMOTE_ADDR]";

// Thank You for the Meter Reading etc.
PRINT "Thank you

Your message has been sent.
Thank you {$HTTP_POST_VARS[‘AcctName’]}, for sending your meter readings.
$number and has been logged.

Back To OURSITE.net

";

// Scrape off the slashes before processing
//$umsg = stripslashes($umsg);

// Here is where we grab and process the form and variables from mailform.php
// and e-mail the results to the value of “$mailto”

ini_set(“SMTP”,“mailrelay.hostingsite.com”);
$mailfrom = ‘From: "’.$_POST[‘AcctName’].’" <’.$_POST[‘Email’].’>’;
$subject= “Meter Readings”;
$body = “* * * * * BEGIN FEEDBACK * * * * nn$number.nnnAccount Name: “.$_POST[‘AcctName’].”.nAccount#: “.$_POST[‘AcctNumber’].”.nMeter Reading: “.$_POST[‘Reading’].”.nDate of Reading: “.$_POST[‘ReadingDate’].”.nEmail Address: “.$_POST[‘Email’].”.
nn
* * * * END FEEDBACK * * * * *”;

mail ($mailto, $subject, $body, $mailfrom);

?>[/code]

These 2 lines being the difference:
ini_set(“SMTP”,“mailrelay.hostingsite.com”);
$mailfrom = ‘From: "’.$_POST[‘AcctName’].’" <’.$_POST[‘Email’].’>’;

Sponsor our Newsletter | Privacy Policy | Terms of Service