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 7722669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:14:33+00:00 2026-06-01T04:14:33+00:00

I have the following mail.php file : <?php $name = $_POST[‘name’]; $to = $_POST[‘to’];

  • 0

I have the following mail.php file :

<?php
$name = $_POST['name'];
$to = $_POST['to'];
$from = $_POST['from'];
$subject = $_POST['subject'];
$message = "From: ".$name."\r\n";
$message .= $_POST['message'];
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
?> 

I have following layout to send mail from my app:
enter image description here

I want to send mail to static mail eg: mymail@mail.com after clicking send button.
How can i send mail by calling above php file.
I heard about post method to call above php file
But dont have any idea about it.
Help Please !

  • 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-06-01T04:14:34+00:00Added an answer on June 1, 2026 at 4:14 am

    Here it is:

        public static void sendData(String name, String to, String from, String subject, String message)
        {
            String content = "";
    
            try
            {               
                /* Sends data through a HTTP POST request */
                DefaultHttpClient httpClient = new DefaultHttpClient();
                HttpPost httpPost = new HttpPost("http://your.website.com");
                List <NameValuePair> params = new ArrayList <NameValuePair>();
                params.add(new BasicNameValuePair("name", name));
                params.add(new BasicNameValuePair("to", to));
                params.add(new BasicNameValuePair("from", from));
                params.add(new BasicNameValuePair("subject", subject));
                params.add(new BasicNameValuePair("message", message));
                httpPost.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));
    
                /* Reads the server response */
                HttpResponse response = httpClient.execute(httpPost);
                InputStream in = response.getEntity().getContent();
    
                StringBuffer sb = new StringBuffer();
                int chr;
                while ((chr = in.read()) != -1)
                {
                    sb.append((char) chr);
                }
                content = sb.toString();
                in.close();
    
                /* If there is a response, display it */
                if (!content.equals(""))
                {
                    Log.i("HTTP Response", content);
                }
            }
            catch (Exception e)
            {
                e.printStackTrace();
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using PHP mail and I have the following headers: MIME-Version: 1.0 Content-Type: text/html;
I have following ant mail task - <target name=sendtestreport > <mail mailhost=smtp.com mailport=1025 subject=Test
I have a page that has the following php: <?php $mail = $_GET[mail]; if
I have the following code that sends a message using the mail() function. Everything
I have following PHP code to submit single input: <?php $headers = 'MIME-Version: 1.0'
I am trying to send an email from PHP using PHPmailer() . I have
I have the following mail php script, and would like to add 2 new
I have send an email using php mailer class. mail was sending successfully but
sending mail along with embedded image using asp.net I have already used following but
I have following text in a file 23456789 When I tried to replace the

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.