Skip to content
Loading
  • Dipankar Biswas
    0
    Hi
    see this video to clear concept ...https://www.youtube.com/watch?v=o4acVCCbJcI

    Thanks...
    0
  • 0
    Hi Dipankar,

    Thank you for your reply. I tried as follows. It shows the mail sent.But i haven't received any mail.
    My code is following : 
     in mail.php :

    $send_to = '[email protected]';
    $send_subject = "Contact Form";


    $f_name = cleanupentries($_POST["name"]);
    $f_email = cleanupentries($_POST["email"]);
    $f_message = cleanupentries($_POST["message"]);
    $from_ip = $_SERVER['REMOTE_ADDR'];
    $from_browser = $_SERVER['HTTP_USER_AGENT'];

    function cleanupentries($entry) {
    $entry = trim($entry);
    $entry = stripslashes($entry);
    $entry = htmlspecialchars($entry);

    return $entry;
    }

    $message = "This email was submitted on " . date('m-d-Y') . 
    "\n\nName: " . $f_name . 
    "\n\nE-mail: " . $f_email . 
    "\n\nMessage: \n" . $f_message . 
    "\n\n\nTechnical Details:\n" . $from_ip . "\n" . $from_browser;

    $send_subject .= " - {$f_name}";

    $headers = "";

    if (!$f_email) {
    echo "no email";
    exit;
    }else if (!$f_name){
    echo "no name";
    exit;
    }else{
    if (filter_var($f_email, FILTER_VALIDATE_EMAIL)) {
    mail($send_to, $send_subject, $message, $headers);
            header( "Location: thank_you.html" );
    echo "true";
    }else{
    echo "invalid email";
    exit;
    }
    }


    in ContactForm.html

     
                       
                           
                               
                               
                               
    Please enter name
                           
                           
                               
                               
                               
    E-mail is not a valid format
                           
                       
                       
                           
                               
                               
                               
    Please enter message
                           
                       
                       
                       
                           
                               
    E-mail was successfully sent.
                               
    There was a problem validating the form please check!
                               
    The connection to the server timed out!
                               
                               
                           
                       
                   

    Everything looks fine. But not receiving the mail.. 

    Can anyone give me suggestion to solve this
    0
  • 0
    Hi all,

    I want to send email from html page only. Is there any possibility to send email using html,ajax,jquery without using PHP ? can anyone guide me to done this ? Thanks in advance
    0