| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: Jul 2006 Location: in my dreams
Posts: 2,729
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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 |
| |
| | #2 (permalink) |
| Traveller Join Date: Mar 2007 Location: Yet another city
Posts: 1,419
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Notice that your last line of code: PHP Code: ????: NamePros.com http://www.namepros.com/showthread.php?t=472368 PHP Code: http://php.net/manual/en/function.mail.php So I think you want: PHP Code:
__________________ NameCooler.com |
| |
| | THREAD STARTER #4 (permalink) |
| Senior Member Join Date: Jul 2006 Location: in my dreams
Posts: 2,729
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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 |
| |
| | #5 (permalink) |
| Traveller Join Date: Mar 2007 Location: Yet another city
Posts: 1,419
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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:
__________________ NameCooler.com |
| |
| | THREAD STARTER #6 (permalink) |
| Senior Member Join Date: Jul 2006 Location: in my dreams
Posts: 2,729
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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 |
| |
| | #7 (permalink) |
| NamePros Regular Join Date: Jul 2007 Location: UK
Posts: 394
![]() ![]() ![]() ![]() ![]() ![]() ![]() | Try Code: mail($to, $betreff, $mailbody, $sender); mail($sender, "this is an autoresponder", $mailbody, "From: $to\r\n"); ????: 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 |
| |