Send to one email address or another

Been playing around with an email contact form with PHP so that the user can select which place they want their enquiry to go to, depending on which radio box they check.

It seems to send to the second address, but not the first.

“sendto” is the name of the radio boxes.

I think I have it working through using ‘switch’, however I want to know why this way didn’t work.

Can anyone shed some light on this for me?


<?php

    $sendto = $_POST['sendto'];
    $subject = "Enquiry";
    $name = $_POST['name'];
    $phone = $_POST['phone'];
    $email = $_POST['email'];
    $message = $_POST['message'];
    
    if($sento == "value1") {
    
    $to = "value1email@whatever.com";
    $body = "Name: $name
Phone: $phone
Email: $email
Message: $message
";
    
    echo "Thank you. Your enquiry has been submitted to location 1.";
    mail($to, $subject, $body);
    
    } 
    
    elseif($sendto == "value2") {
    
    $to = "value2email@whatever.com";
    $body = "Name: $name
Phone: $phone
Email: $email
Message: $message
";
    
    echo "Thank you. Your enquiry has been submitted to location 2.";
    mail($to, $subject, $body);
    
    }
    
    else{
    echo "An error has occured. Please try again later.";
    }
?>