Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 136,582 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,936 people online right now. Registration is fast and FREE... Join Now!




E-mail address encryption in PHP Send Mail

 
Reply to this topicStart new topic

E-mail address encryption in PHP Send Mail, Can anyone help?

doug_young
2 Oct, 2008 - 04:49 AM
Post #1

New D.I.C Head
*

Joined: 2 Oct, 2008
Posts: 1

I use the following code to send a comment/contact form. Is there any way to encrypt the "$mailsent = mail("reikifeedback-website01@yahoo.co.uk", $name, $details);" line so that the actual e-mail address is not picked up by spammers? Thanks :-)

Doug

CODE


<TITLE>Mail Sent!</TITLE>

<body bgcolor="#FFCCFF" text="#000000">
<?php
$name = $_POST["name"];
$email = $_POST["email"];
$address1 = $_POST["address1"];
$address2 = $_POST["address2"];
$county = $_POST["county"];
$contacttype = $_POST["contacttype"];
$comments = $_POST["comments"];
$headers = "From : " . $email . "\r\n";
$details = "From : " . $name . "\r\n" . "Address : " . $address1 . "," . $address2 . "," . $county . "," . $contacttype . "," . $comments . "," . $email;
$mailsent = mail("reikifeedback-website01@yahoo.co.uk", $name, $details);
if ($mailsent) {
echo "Congratulations!  The following message has been sent: <BR><BR>";
echo "<B>Name:</B> $name<BR>";
echo "<B>Email:</B> $email<BR>";
echo "<B>Address1:</B> $address1<BR>";
echo "<B>Address2:</B> $address2<BR>";
echo "<B>County:</B> $county<BR>";
echo "<B>ContactType:</B> $contacttype<BR>";
echo "<B>Comments:</B> <BR>";
echo $comments;
} else {
    echo "There was an error...";
}
?>
<meta http-equiv="refresh" content="5 URL=main.html">
<B>You will shortly we taken back to the opening page - if this does not happen <A HREF="main.html" TARGET="mainFrame">click here</A></B>




User is offlineProfile CardPM
+Quote Post

JackOfAllTrades
RE: E-mail Address Encryption In PHP Send Mail
2 Oct, 2008 - 05:11 AM
Post #2

Cantankerous Old Fart
Group Icon

Joined: 23 Aug, 2008
Posts: 580



Thanked: 59 times
Dream Kudos: 50
My Contributions
PHP runs on the server, so that email address is not visible to email harvesters.
User is offlineProfile CardPM
+Quote Post

Hary
RE: E-mail Address Encryption In PHP Send Mail
2 Oct, 2008 - 12:25 PM
Post #3

D.I.C Head
**

Joined: 23 Sep, 2008
Posts: 205



Thanked: 15 times
My Contributions
This line is useless btw:
$headers = "From : " . $email . "\r\n";
User is offlineProfile CardPM
+Quote Post

pr4y
RE: E-mail Address Encryption In PHP Send Mail
2 Oct, 2008 - 05:47 PM
Post #4

D.I.C Head
Group Icon

Joined: 19 Sep, 2008
Posts: 76


Dream Kudos: 50
My Contributions
QUOTE(Hary @ 2 Oct, 2008 - 01:25 PM) *

This line is useless btw:
$headers = "From : " . $email . "\r\n";



As he said, you have created your mail $headers, but never used them. Your $details variable is doing what the $headers is supposed to do. Obviously, you don't need to stick to specific variable names as it is all just personal preference... but for neatness and efficiency there is no need to have variables that are never called.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/3/08 12:41AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month