Dynadot โ€” .com Transfer

Email link to a friend code ??

Spaceship Spaceship
Watch

gazzip

First Time Poster !VIP Member
Impact
186
Hi All :) Anyone know the html code for emailing a link to a friend - one where you can also put in the email subject and a couple of lines about what the link is about ?

Appreciate any help you can provide :) Thanks



.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
With plain HTML the most you can do is:
<a href="mailto:[email protected]">Tell a Friend</a>
which will bring up the users default mail program eg: Outlook.
I suggest not using this method as most people don't use these email clients.

On the otherhand, you could create a HTML 'form' which is processed by PHP which is probably the best way to do this.
 
0
•••
I think this is what he wanted... Put all that in one php page in the following order.. The following code is a form that posts to it self to send mail..


PHP:
<?php
 if (!isset($_POST["send"])){
   
// no post data -> display form
?>
HTML:
 <form method="POST" action="<?=$_SERVER['PHP_SELF'];?>">
   To: <input type="text" name="to">
   From: <input type="text" name="sender">
   Subject : <input type="text" name="subject">
   Message : 
   <textarea name="message" rows="10" cols="60" lines="20"></textarea>
   <input type="submit" name="send" value="Send">
   </form>
PHP:
<?php 
 }else{

   // found post data
   $from=$_POST['sender'];
  $to=$_POST['to'];

   // send mail :

   if (mail($to,$_POST['subject'],$_POST['message'],"From: $from\n")){
     // display confirmation message if mail sent successfully
     echo "Your mail sent to $to.";
 }else{
   // sending failed
    echo "Your mail could not be sent.";
   }
 }
 ?>
 
1
•••
Thanks Guys - That php stuff looks a little confusing to me though..well, alot :'(

Maybe it is a javascript code I need ?? I have used it once years ago and I think it was just a case of popping a piece of code in the header as far as I remember.

Anyone know if there is such a javascript code for this ?



.
 
0
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
Domain Recover
DomainEasy โ€” Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back