The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP Clueless

Discussion in 'E-mail Discussions' started by hippie1975, Jan 26, 2013.

  1. hippie1975

    hippie1975 Registered

    Joined:
    Jan 26, 2013
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I am trying to activate my contact page, but I am clueless regarding php scripts. My page loads correctly, but just won't send emails... can anyone help?

    Here is my php code:

    PHP:
    $_POST;

    // Contact 
    $contact_name="$your_name"

    // Message
    $contact_textarea="$your_message";

    // Mail of sender
    $contact="$your_email"

    // Enter your email address
    $to="contact@alaingariepy.ca";
    $send_contact="mail($your_name,$your_message,$your_email)";

    // Check, if message sent to your email 
    // display message "We recived your information"
    if($send_contact){
    echo 
    "Votre message a été envoyé avec succès. Merci!";
    }
    else {
    echo 
    "ERREUR. Essayez à nouveau.";
    }
    ?> 
     
  2. Greenhost

    Greenhost Well-Known Member

    Joined:
    Jan 22, 2013
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    You should specify the receiver.
    $send_contact="mail(Receiver,Subject,$Message,Sender)";
    Change the above line :

    $send_contact="mail($to,$your_name,$your_message,$your_email)";

    // Check, if message sent to your email
    // display message "We recived your information"
    if($send_contact){
    echo "Votre message a été envoyé avec succès. Merci!";
    }
    else {
    echo "ERREUR. Essayez à nouveau.";
    }
    ?>
     
Loading...

Share This Page