Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

PHP Clueless

Discussion in 'E-mail Discussion' 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.";
    }
    ?>
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice