After a user adds 5 emails and their name to form below, and then hits the “send” button, I would like to send a message such as “Hello, your friend ‘sendername’ recommends that you use thissite.com. Please visit the site.” I would also like to specify the from address that this email has on it.
What PHP script could do this?
Thanks in advance,
JOhn
<div class="email1">
<form method="post" action="friends.php">
email address of friend 1:<br>
<input name="email1" type="text" size="55"><br>
<br>
email address of friend 2:<br>
<input name="email2" type="text" size="55"><br>
<br>
email address of friend 3:<br>
<input name="email3" type="text" size="55"><br>
<br>
email address of friend 4:<br>
<input name="email4" type="text" size="55"><br>
<br>
email address of friend 5:<br>
<input name="email5" type="text" size="55"><br>
<br>
your name:<br>
<input name="sendername" type="text" size="55"><br>
<br>
<input type="submit" value="send" name="Send" id="Send"/>
</form>
You can use the mail function of php.
The code would be something like this
Also changing your form to that would make the code more easy
It would recude the code to
Hope this helps.
your comment code