How to send an email to recipient [closed] - php

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I know that there are multiple posts and questions out there on How to send an email from HTML form. But, I am having a slightly different query.
I have an HTML form, what I want is that when I click on submit, it should not show the information in a mail, but it should directly send the form information to recipients email ID. When I tried the following code:
<form action="mailto:dummy1#chamisplace.com" method="POST"
enctype="multipart/form-data"
name="EmailTestForm">
Your Name:<br>
<input type="text" size="20" name="VisitorName"><br><br>
Your Comment:<br>
<textarea name="VisitorComment" rows="4" cols="20">
</textarea><br><br>
<input type="submit" value="Email This Form">
</form>
It is opening a MS Outlook window with the form information. But it is not sending it automatically.

use mail() function of php
mail($email_to, $email_subject, $email_body)
and you have to configure ur email
http://stackoverflow.com/a/18185233/2535521

<?php
$to="mailaddredd";
$from= "ownmailaddress";
$subject="Subject";
$message ="Comments";
mail($to,$subject,$message);
?>

If you are using only mailto for your action and not using any PHP script you can't send it automatically because you are having your form open and send data to the users prefered email program which can't be controlled remotely as far as sending emails. That is a good thing because that would be a way to spam people without thinking/knowing about it.
If you are looking to use PHP to send an email there's tons of libraries and tutorials on this site or even searching Google.

Related

How to transfer form data from one html page to another? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have a registration page, having 3 columns username, email, and password. Login Page, consisting of 2 columns email and password now I want to show the username of the corresponding email while logging into the page.
Note- I just want to know how can I fetch the value entered in email to another page.
Thanks in Advance!!
you can get user information like this
sessionService.loadUser().then(user => console.log(user));
you could do this:
page1.php:
<form action="page2.php" method="POST">
<input type="text" name="name" />
<input type="text" name="surname" />
<input type="button" value="Click Me">
</form>
Then once you submit the form the file page2.php will receive the form field values in this way;
page2.php
if($_POST){
var_dump($_POST);
}
good luck!

Send different pieces of PHP form data to different email addresses on 1 submit button [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Is there a way to send different pieces of data from a PHP form to different email recipients using 1 submit button?
For instance, when a user clicks 'SUBMIT', I want to send ONLY the user's name, address, email address, and phone number to company email address "A", and send the user's complaint/message and model information to company email address 'B'.
**I'm new to PHP and have tried researching the issue, but I may be using the wrong terminology. (So any help would be appreciated THERE too.)
THANKS SO MUCH!
Yes there is. you should use mail function for this purpose. You have an action parameter in your html form like this:
<form name="user_data" action="submit.php" method="post">
// form fields here ...
</form>
and in your submit.php after sanitizing, validating and processing form data you will have:
mail("someone#example1.com","Subject1",$msg1);
mail("someotherone#example2.com","Subject2",$msg2);
where $msg1 and $msg2 are composed messages, containing any parts you need.

how to make a php page to send data to other page? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
How can I make a php page so that when I click on the button,another page is created with the text like as "Hello World"
And It all must be happened on the website.
It would be great of you if you can help!
Thank YOu
I have way to little information to really help you.
But it is possible to send a variable to another page by pressing a button.
You need to create 2 files: home.php and message.php.
home.php, the page from where we sent our message. Change value to whatever message you are trying to send
<form action="test4.php" methode="POST">
<input type="hidden" name="text" value="Hello World">
<input type="submit" value="Submit">
</form>
message.php, the page where we receive our message
<?php
if(isset($_POST['text'])){
echo $_POST['text'];
}
?>

Is there a way to call another website's HTML form's submit action with php? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I'm trying to figure out how to automatically get the search results from
http://pokemonshowdown.com/replay/
<form action="/replay/search/" method="get" data-target="replace">
<p style="text-align:center">
<label><input type="text" name="user" class="textbox" placeholder="Format or username" size="24" /></label>
<button type="submit"><strong>Search</strong></button>
</p>
</form>
but I don't know how to trigger the onsubmit action of the form using code, only by clicking on it X_X
I plan on getting the search results and using them to automatically cycle through replays so I don't have to keep clicking on them to watch.
If I got you right you want to initiate a search on an exterior site? Because it is a get-form it should be easily done by requesting the URL "http://pokemonshowdown.com/replay/search/?key=value". You do not have to really submit the form, just call the URL the form would call in case of an onclick-event.
Of course key and value have to be replaced by the field name and the value you want to insert. Multiple parameters would be concatenated, like key1=value1&key2=value2.

Send email from html form without php [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Is there a service that allows you to post a form to it from an html page (my php mail isn't working temporarily and I need a quick solution) and it will automatically send an email with specified content to a specified address?
The address it comes from is insignificant.
Check out formspree.
https://github.com/asm-products/formspree
For action you simply put:
<form action="http://formspree.io/you#email.com" method="post">
<input type="text" name="name">
<input type="email" name="_replyto">
<input type="submit" value="Send">
After verifying your email after the first send this will email you the contents of the form. One thing to keep in mind is that this will take the input names. If you do not include input names it won't send you that form field.
There's no perfect solution because they are still encoded as url variables. Setting the enctype to plaintext makes it somewhat more acceptable.
<form action="mailto:email#example.com" enctype="text/plain">
<textarea></textarea>
</form>
I don't believe you can within the website. As the others stated, you can use mailto:someone#blahblah.com, but that is not automatic and it opens the user's default email editor. You could use http://www.emailmeform.com/ though. It lets you make a form and it will send an email to you.
in your html form provide a mailto action.
for example
<form action="mailto:yourdest#email.com">
.....
</form>

Categories