I have put a website up on the internet, and I want to have a function where a user can enter their email address into a form and when submitted, they will receive a pre-set email.
There are other questions, but none of them seemed to help me.
I have basic code here:
<form action="send.php" method="post">
<input type="text" name="mail">
<input type="submit" value="send">
</form>
Here is the send.php
<?php
$mail = $_POST['mail'];
?>
<html>
<a href="mailto:<?php echo $mail ?>"><button>SEND</button></a>
</html>
Please excuse the fact that you have to press send twice, I will change that.
What I want to do, is send the user (email is represented by $mail
) a pre written document via email, not as an attachment, but a the composition of the email.
I am unsure as to weather i can just use a word document, or there is complex code behind it.
Since i am only familiar with basic visual elements, please could you explain what parts of the code do what, as i may want to tweak it.
Thanks!