NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page php mail form problem

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 05-22-2008, 09:16 AM THREAD STARTER               #1 (permalink)
Senior Member
 
liquidcherry's Avatar
Join Date: Jul 2006
Location: in my dreams
Posts: 2,729
liquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond repute
 


Ethan Allen Fund Animal Rescue Protect Our Planet Save a Life Wildlife Help The Homeless - Holiday 2009

php mail form problem


Hi everybody,

I tried to add an autorespond message to one of my php forms, and it worked...
(and that is exciting because i am not a programmer at all, my php knowledge stops after"hello world")

But.....the sender who fills out my form receives the autoresponder from "nobody" send with my servername emailaddress (e.g Nobody [nobody@host1.servername.com] )...i would like that to be from the email address defined in $to

Anybody out to my rescue?

Here is the code:

<?php

$betreff = "Booking Form";
$to = "email@franksform.com";
$sender = "From: $email<$email>";
$mailbody = "From: $fname $lname\n";
$mailbody = $mailbody."company $company\n";
$mailbody = $mailbody."phonenumber:$phone\n";
$mailbody = $mailbody."eMail: $email\n\n";
????: NamePros.com http://www.namepros.com/programming/472368-php-mail-form-problem.html
$mailbody = $mailbody."phone2: $phone2\n\n";
$mailbody = $mailbody."Event Date: $eventdate\n\n";
$mailbody = $mailbody."Event Time: $eventtime\n\n";
$mailbody = $mailbody."Duration: $duration\n\n";
$mailbody = $mailbody."Number of People: $people\n\n";
$mailbody = $mailbody."Kind opf Event: $eventkind\n\n";
$mailbody = $mailbody."Private Area : $private\n\n";
$mailbody = $mailbody."Providing Drinks : $drinks\n\n";
$mailbody = $mailbody."Providing Food: $food\n\n";
$mailbody = $mailbody."Special Needs : $specials\n\n";
$mailbody = $mailbody."Special Needs : $specials1\n\n";
$mailbody = $mailbody."Special Needs : $specials2\n\n";
$mailbody = $mailbody."Special Needs : $specials3\n\n";
$mailbody = $mailbody."Special Needs : $specials4\n\n";
$mailbody = $mailbody."Special Needs : $specials5\n\n";
$mailbody = $mailbody."Special Needs : $specials6\n\n";
$mailbody = $mailbody."Comment : $comment";
mail($to, $betreff, $mailbody, $sender);
mail($sender, "this is an autoresponder");
?>

Cheers

Frank
liquidcherry is offline  
Old 05-22-2008, 09:26 AM   #2 (permalink)
Traveller
 
-NC-'s Avatar
Join Date: Mar 2007
Location: Yet another city
Posts: 1,419
-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future
 


Animal Cruelty Animal Rescue Ethan Allen Fund Protect Our Planet
Notice that your last line of code:
PHP Code:
mail($sender"this is an autoresponder"); 
Only contains 2 parameters, whereas the one above it contains 4:
????: NamePros.com http://www.namepros.com/showthread.php?t=472368
PHP Code:
mail($to$betreff$mailbody$sender); 
The parameters for the mail function:
http://php.net/manual/en/function.mail.php

So I think you want:
PHP Code:
mail($sender"this is an autoresponder","message",$to); 
__________________
NameCooler.com
-NC- is offline  
Old 05-22-2008, 11:58 AM   #3 (permalink)
Senior Member
Join Date: Apr 2005
Location: Joliet, Illinois
Posts: 1,177
RageD is a splendid one to beholdRageD is a splendid one to beholdRageD is a splendid one to beholdRageD is a splendid one to beholdRageD is a splendid one to beholdRageD is a splendid one to beholdRageD is a splendid one to beholdRageD is a splendid one to behold
 


Child Abuse
*EDIT* Doh! Ignore statement read first post wrong -NC- has you covered

-RageD
RageD is offline  
Old 05-22-2008, 02:24 PM THREAD STARTER               #4 (permalink)
Senior Member
 
liquidcherry's Avatar
Join Date: Jul 2006
Location: in my dreams
Posts: 2,729
liquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond repute
 


Ethan Allen Fund Animal Rescue Protect Our Planet Save a Life Wildlife Help The Homeless - Holiday 2009
Hi Guys,

The last line was wrong when i posted, sorry...
But i exchanged it with the code from NC and all what i get is the booking form/response...no autoresponder at all

(Unfortunately like i said, i am a total noob and if i ask stupid questions forgive me) I am no longer affiliated with my house php coder who helped me out with things like that

Any other ideas?

Regards,

Frank
liquidcherry is offline  
Old 05-22-2008, 03:16 PM   #5 (permalink)
Traveller
 
-NC-'s Avatar
Join Date: Mar 2007
Location: Yet another city
Posts: 1,419
-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future
 


Animal Cruelty Animal Rescue Ethan Allen Fund Protect Our Planet
Just had another look and $sender might be a valid from address, but it might not work for to. ( because of the other text in it, e.g. "from:" ).

try:
PHP Code:
 mail($email"this is an autoresponder","message",$to); 
__________________
NameCooler.com
-NC- is offline  
Old 05-22-2008, 06:32 PM THREAD STARTER               #6 (permalink)
Senior Member
 
liquidcherry's Avatar
Join Date: Jul 2006
Location: in my dreams
Posts: 2,729
liquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond reputeliquidcherry has a reputation beyond repute
 


Ethan Allen Fund Animal Rescue Protect Our Planet Save a Life Wildlife Help The Homeless - Holiday 2009
Hi NC,

No luck, all what i get is the booking form with the infos, no autoresponder(i am used differnt email addresses to check)

Well, i guess i have to hire someone her....i will post in the other forum :-(

But thx for your help..

Cheers,

Frank
liquidcherry is offline  
Old 05-23-2008, 04:18 AM   #7 (permalink)
NamePros Regular
 
qbert220's Avatar
Join Date: Jul 2007
Location: UK
Posts: 394
qbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to behold
 


Protect Our Planet
Try

Code:
mail($to, $betreff, $mailbody, $sender);
mail($sender, "this is an autoresponder", $mailbody, "From: $to\r\n");
$to is "email@franksform.com". The 4th parameter need to be a mail header (i.e. "From: email@franksform.com").
????: NamePros.com http://www.namepros.com/showthread.php?t=472368

Note - make sure that you check $email before this function to avoid abuse of your mail form (I'm assuming $email is a GET/POST variable).

qbert
qbert220 is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 02:27 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger