Welcome Guest ( Log In | Register )



 
Closed TopicStart new topic
> Do You Want A Mail Form In Your Site
ejasoft
post May 2 2005, 11:57 PM
Post #1


Newbie [ Level 2 ]
Group Icon

Group: Banned
Posts: 18
Joined: 2-May 05
Member No.: 4,656



Notice from m^e:
Repeat post. Credits reduced by 5 days. Learn to USE THE SEARCH BUTTON before you make such posts.


did you want to have in your web site mail form
that allow the user
to send mails to anther mail from his mail e.g. the compose in yahoo
CODE


<body>
<form name="email" method="post">
<table align="center">
<tr>
<td>from</td>
<td align="right"><input type="text" size="60" name="from" /></td>
</tr>

<tr>
<td>to</td>
<td align="right"><input type="text" size="60" name="to" /></td>
</tr>

<tr>
<td>cc</td>
<td align="right"><input type="text" size="60" name="cc" /></td>
</tr>

<tr>
<td>bcc</td>
<td align="right"><input type="text" size="60" name="bcc" /></td>
</tr>

<tr>
<td>subject</td>
<td align="right"><input type="text" size="60" name="subject" /></td>
</tr>

<tr>
<td colspan="2">
<textarea name="body" cols="60" rows="10">
</textarea>
</td>
</tr>

<tr>
<td colspan="2" align="right">
<input type="submit" value="send" />
</td>
</tr>
</table>
</form>

<?
function param($Name)
        {
        global $HTTP_POST_VARS;

        if(isset($HTTP_POST_VARS[$Name]))
           return($HTTP_POST_VARS[$Name]);

        return("");
        }

$from = param("from");
$to = param("to");
$cc = param("cc");
$bcc = param("bcc");
$subject = param("subject");
$body = param("body");

if($from != "" && $to != "" && $subject != "")
 {
 $headers = "From: " . $from . "\n" .
            "To: " . $to . "\n" .
            "CC: " . $cc . "\n" .
            "BCC: " . $bcc;

 mail("", $subject, $body, $headers);
 }
?>

</body>
</html>

that`s all

This post has been edited by microscopic^earthling: May 3 2005, 12:11 PM
Go to the top of the page
 
+Quote Post
nakulgupta
post May 3 2005, 11:48 AM
Post #2


Advanced Member
Group Icon

Group: Members
Posts: 173
Joined: 22-March 05
From: Hyderabad,India
Member No.: 3,155



Does the above code have any risks?? Like can it be used to spoof e-mail addresses??
Go to the top of the page
 
+Quote Post
miCRoSCoPiC^eaRt...
post May 3 2005, 12:09 PM
Post #3


PsYcheDeLiC dR3aMeR
Group Icon

Group: Admin
Posts: 2,242
Joined: 29-January 05
From: Nakorn Chaisri, Thailand
Member No.: 2,411
myCENTs:84.36



Spoof as in you can enter any random email address - as you can with any form mailers... there's no certain way to check that it is your authentic address unless you put some email activation mechanism following the form feedback... but then that's a total overkill when you're using this form to simply submit comments. Email verification is good for only forum & site memberships...

Anyway, I think this code is useless at this point, coz we've already posted this 2-3 times before in both javaScript and PHP sections.. While it's a good attempt, this shows that people still DO NOT use the SEARCH button before posting. One of the previous articles can clearly be found under PHP Form to Email title.

Credits adjusted for this....
Go to the top of the page
 
+Quote Post

Closed TopicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. How Do U Make Members Only Web-site(7)
  2. Php Script To Download File From Another Site(9)
  3. Site Counters - Help Needed(13)
  4. PHP Based Site Access Authentication - Help(4)
  5. Mail() Not Working(4)
  6. Form Mail Php - Use Php To Send Form Through Email(8)
  7. How To Use Cookie In Your Web Site ?(1)
  8. Simple E-mail Validation(2)
  9. Using Bitflags To Restrict Site/page Permissions(1)
  10. Sending Mail To A Mailing List(12)
  11. Multilingual Site: Send The User To Page Of Choice(6)
  12. Need Help Is Adding A PHP Based News Module To My Site(2)
  13. Dynamic Site Design - Where Do I Start ?(7)
  14. Using The Php Mail() Function For Images Or Attachments(6)
  15. E-mail List Error(4)
  1. Should This Great Site Offer Imagemagick ?(3)
  2. Php Send Mail Through Smtp(8)
  3. PHP: Need Help Sending Mail Using SMTP(5)
  4. Using Php With A Mail Server(2)


 



- Lo-Fi Version Time is now: 5th December 2008 - 02:26 PM