Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5958537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:33:26+00:00 2026-05-22T18:33:26+00:00

I have developed a simple php application. This application contains one html file and

  • 0

I have developed a simple php application. This application contains one html file and one php file. What i am doing is when user selects two dates and enters his/her email addresss, i am calling my php file which is sending the mail to entered email id.

It sends the mail correctly. But the problem is its not showing me the status whether mail is sent or not. I am using alert.

This is my html file :

<html>
<link rel="stylesheet" href="ui.all.css" type="text/css" media="screen" />
</head>
<body>
        <label>Leave Application</label><br/>
    From <input id="date" type="text"  name="ndate" /><div id="d1"></div><br/>
        To <input id="date1" type="text"  name="ndate1" /><div id="d2"></div><br/>
        Email To <input type="text" id="UserEmail" name="userEmail" onkeyup=""/><br/>
        <input type="submit" id="btn_submit" value="Send" onclick="" />


    <span id="d"></span>

    <script type="text/javascript" src="jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.3/jquery-ui.min.js"></script>


        <script type="text/javascript">
        $(document).ready(function(){
                $("#date").datepicker({ showOn: 'button', buttonImageOnly: true, buttonImage: 'Images/icon_cal.png' });
                        $("#date1").datepicker({ showOn: 'button', buttonImageOnly: true, buttonImage: 'Images/icon_cal.png' });
        });

                 $("#btn_submit").click(function(event){

                     var hasError = false;
                        var dt1=$("#date").val();
                     var dt2=$("#date1").val();
                     var em=$("#UserEmail").val();
                     $(".error").hide();

                      if(dt1 == '')
                          {
                            $("#d1").before('<span class="error"><font color="red">This Field Must not be empty.</font></span>');
                            hasError = true;
                           }

                        if(dt2 == '')
                        {
                            $("#d2").before('<span class="error"><font color="red">This Field Must not be empty.</font></span>');
                            hasError = true;
                        }

                        var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;

                        var emailaddressVal = $("#UserEmail").val();

                        if(emailaddressVal == '') {
                            $("#UserEmail").after('<span class="error"><font color="red">Please enter your email address.</font></span>');
                            hasError = true;
                        }
                        else if(!emailReg.test(emailaddressVal)) {
                            $("#UserEmail").after('<span class="error"><font color="red">Enter a valid email address.</font></span>');
                            hasError = true;
                        }
                        if(hasError == true) { return false; }

                    jQuery.ajax({
                        type: "GET",
                        url: "http://www.myserver.com/sent_mail.php",                        
                        async: false,
                        data: "dt1="+dt1+"&dt2="+dt2+"&email="+em,
                        success: function(msg){
                            alert(msg);
                        }
                    });                    
                 });

    </script>
</body>
</html>

This is my php file :

   <?php
`extract($_GET);`

        $msg="Respected Sir,\n\n\tI will not be able to come to office from ".$dt1." to ".$dt2.". Please grant my leave";

        $pcto=$email;
        $pcsubject = 'Leave Application';
        $pcmessage = $msg;
        $pcheaders = 'From:abc@abc.com'."\r\n" .
                     'Reply-To: abc@abc.com'."\r\n" .
                     'X-Mailer: PHP/' . phpversion();

        $isdone=mail($pcto, $pcsubject, $pcmessage, $pcheaders);

        if($isdone)
            echo "Mail Sent";
        else
            echo "Please Try Again";
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:33:27+00:00Added an answer on May 22, 2026 at 6:33 pm

    Dont know the same code is running for me now…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a simple mechanism for my mvc website to pull in html
I have developed a simple library in Ruby and need to use this in
I have developed a simple location aware iPhone application which is functionally working very
I have developed a simple application for study of sql injection where i search
i have developed a simple php contact form, that's working fine, but i am
I have a developed a application that allows users to draw simple images on
I'd like to have a simple & lightweight library/application in PHP/Python/C/C++ library/application to match/correct/give
I have developed a simple application that uses APNS. The app runs fine and
I have a simple windows Service developed in VS.net 2008 and VB.net. When I
I have a very simple windows Service that is developed in vb.net 2008. When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.