Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • jaco steketee 30 posts 187 karma points
    May 16, 2016 @ 10:28
    jaco steketee
    0

    is it possible to use a php mail script/ form in Umbraco

    Hi, Can someone please help me out:) Im trying to get a php form to work in Umbraco. Does anyone know if that is possible?

    Kind regards, Jaco Steketee

    <?php
                        $mail = $_POST['email_booking'];
    
                        $to = "#";  /*YOUR EMAIL HERE*/
                        $subject = "Aanvraag van Marstrand Rondvaarten";
                        $headers = "Van: Marstrand|Rondvaarten <noreply#yourdomain.com>";
                        $message = "UW BOEKING voor Zeeuws Wadlopen\n";
                        $message .= "\nNaam: " . $_POST['name_booking'];
                        $message .= "\nAchternaam: " . $_POST['last_name_booking'];
                        $message .= "\nEmail: " . $_POST['email_booking'];
                        $message .= "\nTelefoon nummer: " . $_POST['phone_booking'];
                        $message .= "\nDatum boeking: " . $_POST['date_booking'];
                        $message .= "\nTijd boeking: " . $_POST['time_booking'];
                        $message .= "\nVolwassenen: " . $_POST['adults'];
                        $message .= "\nKinderen: " . $_POST['children'];
                        $message .= "\nGids Rondleiding: " . $_POST['option_1'];
                        $message .= "\nHaal en brengservice: " . $_POST['option_2'];
                        $message .= "\nVerzekering: " . $_POST['option_3'];
                        $message .= "\nWelkomsdrankje: " . $_POST['option_4'];
                        $message .= "\nKoffie tafel: " . $_POST['option_5'];
                        $message .= "\nDinner: " . $_POST['option_6'];
                        $message .= "\nFietshuur: " . $_POST['option_6'];
    
                        //Receive Variable
                        $sentOk = mail($to,$subject,$message,$headers);
    
                        //Confirmation page
                        $user = "$mail";
                        $usersubject = "Hartelijk dank voor uw boeking bij -Marstrand Rondvaarten";
                        $userheaders = "From: jsteketee#steek-it.nl\n";
                        //Confirmation page WITH  SUMMARY
                        $usermessage = "Dank u voor uw reservering, uw verzoek is succesvol verzonden!.\nWe nemen spoedig contact met u op om uw reservering te bevestigen!\n\n$message"; 
                        mail($user,$usersubject,$usermessage,$userheaders);
                        }
                        ?>
                    <!-- END SEND MAIL SCRIPT -->   
    
  • Nik 1599 posts 7179 karma points MVP 6x c-trib
    May 16, 2016 @ 10:34
    Nik
    100

    Hi Jaco,

    Why are you trying to get a php script to work in a .Net website? You'd be better off quickly re-writing that script into a custom controller.

    Alternatively you'd need to host your php page somewhere and then submit it from the Umbaco page (Not something I would recommend).

    In order to re-write the php script I'd start with look up how to create a surface controller to receive the form. There are a lot of tutorials around of this sort of thing but if you get stuck give us a shout :-)

  • jaco steketee 30 posts 187 karma points
    May 26, 2016 @ 10:24
    jaco steketee
    0

    Thanks for the tip Nik. I had to puzzle a little bit, but it worked out nice :)

Please Sign in or register to post replies

Write your reply to:

Draft