Form handling code stopped working due to PHP upgrade

that means u have to check/change the settings of ur websever.

as u don’t seem to be able to do that on ur own, u have to contact the provider of ur webserver now.

it hard when u neighter have acces to ur webservers configuration nor to ur mailserver, i know.
but somehow u have to get those companys to do what u want.

if not change ur provider!

Thanks Q1712! What settings do I need to ask them change?

ask them to set (if not done already) the mail server to mailrelay.theirsite.com

if this was already done, get back to the mail-server-provider and ask them to check their loggs again.

I believe it is already that way. They (our webserver hosting company) is who told me to use that. I don’t know where to put it in my PHP code though. Or does it go on the html page with the forms code?

has to be in the server configuration.

sry have forgotten that ur site is runing on a windows server.
u may change it in ur script:
http://php.net/mail
[php]ini_set(“SMTP”,“mailrelay.theirsite.com”);[/php]

edit: whoops, you posted my answer to this question before I submitted this one. heheh!

Thanks!
Rick

Does this need to go in a certain place? Or anywhere in the script?

Is this okay?

[code]<?php

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

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

Your message has been sent.
Thank you ".$_POST['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.theirsite.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 * * * * *”;

?>[/code]

no. of cause it has to be set before calling the mail function.

yes. but whers ur mail function gone to? does it work?

Whoops! :o I’ll put it back…not sure how I lost it .

[code]<?php

$title = “Submit your Meter Readings”;
$home = “http://www.cceca.net”;
$mailto = "[email protected]";
$number = “Information Submitted From IP $_SERVER[REMOTE_ADDR]”;

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

Your message has been sent.
Thank you ".$_POST['AcctName'].", for sending your meter readings.
$number and has been logged.

Back To CCECA.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.terrasite.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]

I’ll give this a try and report back. Thanks for continuing to help me!

Rick

Okay, now I get this message again! :-?

Warning: mail() [function.mail]: SMTP server response: 501 unacceptable mail address in D:Inetpuboursite.netread1test.php on line 28

My mail function is line 28:

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

could u echo out $mailto, $subject, $body and $mailfrom.

and tell us whats in there.

[php]

echo “$mailto: $mailtonn”;
echo “$subject: $subjectnn”;
echo “$body: $bodynn”;
echo “$mailfrom: $mailfromnn”;
mail ($mailto, $subject, $body, $mailfrom);[/php]
(use “view source” to copy it)

I think this is what you want:

<form ACTION="read1test.php" METHOD="POST"> <input TYPE="TEXT" NAME="AcctName" SIZE="20"> <input TYPE="TEXT" NAME="AcctNumber" SIZE="20"> <input TYPE="TEXT" NAME="Reading" SIZE="20"> <input TYPE="TEXT" NAME="ReadingDate" SIZE="20"> <input TYPE="TEXT" NAME="Email" SIZE="20">

no.

i want u to put the code i provided in ur script, try to send an email, look at the html source of the “thank u”-page, and copy that to here.

OK. sorry!

Here’s the code from the “thank you” page after submitting the info:

[code]Thank you

Your message has been sent.
Thank you rick test4, for sending your meter readings.
Information Submitted From IP XX.XX.XX.XX and has been logged.

Back To OURSITE.net


Warning: mail() [function.mail]: SMTP server response: 501 unacceptable mail address in D:Inetpuboursite.netread1test.php on line 28
[/code][/code]

u have forgotten to add the code.
[php]

echo “$mailto: $mailtonn”;
echo “$subject: $subjectnn”;
echo “$body: $bodynn”;
echo “$mailfrom: $mailfromnn”;
mail ($mailto, $subject, $body, $mailfrom);[/php]

OK, I think I might have what you want this time :wink:

[code]Thank you

Your message has been sent.
Thank you rick test4, for sending your meter readings.
Information Submitted From IP XX.XX.XX.XX and has been logged.

Back To OURSITE.net

$mailto: [email protected]

$subject: Meter Readings

$body: * * * * * BEGIN FEEDBACK * * * * *

Information Submitted From IP XX.XX.XX.XX.

Account Name: rick test4.
Account#: 12345.
Meter Reading: 1234.
Date of Reading: 09/06/07.
Email Address: [email protected].

          • END FEEDBACK * * * * *

$mailfrom: From: “rick test4” [email protected]


Warning: mail() [function.mail]: SMTP server response: 501 unacceptable mail address in D:Inetpuboursite.netread1test.php on line 32
[/code]

looks ok.

now we are again at the point where i’d sugesst to contact ur provider.

tell tham errorcode and time.

OK, I can try again, but like I said, they already told me this:

When sending email from code, use mailrelay.theirsite.com as your mail server.

If you have any further questions, please contact us

Is there no way to specify this in my code? Or if there is not a way, what exactly do I ask them to do since I’ve already told them everything?

the them that the conection to the smtp works, but that it returns:
“501 unacceptable mail address”
ask thm to ceck their loggs, because the mail is correct. they should find out wy theyr smpt is returning this error.
give them the exact time of a testmail, or the url so that they can send a testmail themselfs.

maybe u have to call them, so they can tell u whether they need mor infos from u.

just talk to them, they woun’t bite u.

Sponsor our Newsletter | Privacy Policy | Terms of Service