i want to send a mail to a friend with my one-page compose mail site, i dont know how to implement the to: field, know a little of

Member Avatar for GreenDay2001

You need to use server side scripts such as ASP, PHP etc.

Is it that you want to send an email to this person...if so this is the script...... (put this where you want the user to type in the content and all that:


<form action="sending.php" method="POST">
Your email address: <input type="text" size="25" maxlength="40 "name="mailer" ><br><br>
Your Name <input type="text" style="margin-left:50px;" size="25" maxlength="40 "name="from" ><br><br>
Message :
<input type="message" class="content" height="150px" name="message">
<br>
<br>
<input type="submit" style="margin-left:20px;"" "value="Send">

</form>

*****and then put this on a page entitled "sending.php"..................:

<?php
$to = "Your_email_address_here@hotmail.co.uk;
$subject = "Your site's message from $from";
$mail = "$from, whos email is $mailer, would like to say : $message";
$body = "$mail";
if (mail($to, $subject, $body)) {
echo("<p>Your message has been sent to the Administrator of this site</p>");
} else {
echo("<p>Message delivery failed...Please try again, and remember to fill in all the forms!</p>");
}
?>

.... and that will be your email form.... on your site your users will be able to send you emails directly from the page! --- oh and all you need to change really is the email.

any help?

Member Avatar for GreenDay2001

Well Designer_101, I am actually surprised that even after 25 posts you dont use [ code ] tags. There are actually [ code ] tags in which you could wrap your code, it would colourise(more precisely Syntax Highlight) and indent your code properly. Read This.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.