Current location: Hot Scripts Forums » Programming Languages » PHP » can you use php to get someone's email address from a mailer?


can you use php to get someone's email address from a mailer?

Reply
  #1 (permalink)  
Old 11-02-05, 11:02 AM
pagetta pagetta is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
can you use php to get someone's email address from a mailer?

I am sending out a mailer where on it people write comments, press submit, and a simple bit of php forwards their comments to my email inbox.

Is there a way that in the PHP script that sends the email to my inbox (I've put the script below) that it can get the person's email address without the person having to type it in? so that when it appears in my inbox the 'from' part has the person's email address in it?

thanks

<?php

//$comments = $HTTP_POST_VARS["comments"];

$comments = $_POST['comments'];

if ($comments!="" && $comments != " ") {

header ("Location: http://thankspage.html");

mail ("me@mail.com","Feedback","$comments","From: staff@company.com");

exit();

}
$status
= "<b>Please make some comments in the space below:<b>";
header ("Location: index.php?status=$status");

?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 11-02-05, 01:39 PM
digioz's Avatar
digioz digioz is offline
Community VIP
 
Join Date: Oct 2003
Location: Chicago, IL
Posts: 2,167
Thanks: 3
Thanked 8 Times in 8 Posts
I am not sure if you know or not, but what you are asking is an invasion of privacy! To grab people's email address without their knowledge is a big no no!

If you want to know people's email address, just ASK them for it.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 11-02-05, 06:11 PM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
Simply ask them for their email addrerss in the form and make it a required field. If they don't supply it there's no way of getting it short of a pie-in-the-sky wild guess.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 11-03-05, 02:38 AM
nugensoftware's Avatar
nugensoftware nugensoftware is offline
Newbie Coder
 
Join Date: Oct 2005
Location: United States
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
When sending the email - set a hidden form field to the persons email address, when the form submits its information you will have the email address. Another method is that if they click a link to do this, have the link have their email in it like: mysite.com/commments.php?user=myemail@test.com

I am guessing that since you sent the email to them originally you already have their email address which would negate it being an invasion of privacy, that is unless you obtained it unlawfully in the start. In which case have fun getting a lawyer lol.
__________________
Nugen Software Inc.
Lead Developer
www.nugensoftware.com

PHP HELP | MySQL HELP | xmlSYNC
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 11-03-05, 07:34 AM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
I think it's just a simple email form which visitors are filling out.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 11-03-05, 09:40 AM
digioz's Avatar
digioz digioz is offline
Community VIP
 
Join Date: Oct 2003
Location: Chicago, IL
Posts: 2,167
Thanks: 3
Thanked 8 Times in 8 Posts
I guess part of the confusion is the way the original question was asked.

pagetta: Do you have the users email address already stored somewhere on your server? Are users logging in before filling the comment form, or is it a simple web form with no registation requirement ?
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 11-03-05, 11:05 AM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
A server side script, by it self, cannot get at a person's email address (think of the spam problems that would cause.) Just have them enter it as Keith suggests, basically, so that they are on notice that they have given it to you of their own freewill.

The closest you can probably come to accomplishing what you ask for is to use a mailto:youremail@yourdomain.com?subject=Comment link that will open and use their email client to send the comment to you.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #8 (permalink)  
Old 11-03-05, 11:29 AM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
The following is a link to a javascript (I wonder if PHP could generate a mailto: link as the submit action?) that does a form that generates a mailto: link when the submit button is pressed and causes the information entered in the form to be sent using the users email client...

http://www.hotscripts.com/Detailed/8201.html

If you want to go the mailto: direction, here is a link I found on the syntax you can use - http://www.ianr.unl.edu/internet/mailto.html

Last edited by mab; 11-03-05 at 11:47 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #9 (permalink)  
Old 11-11-05, 06:36 AM
pagetta pagetta is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for the advice everyone - technical and legal - sorry for late reply!

It was just for internal purposes for a bit of fun for the christmas party (stitching people up basically!) evil but potential for a lot of fun! we wanted to ask for anonymous stuff but really its not anonymous.

Some good stuff to look at there though so will have a look through it for future use.

For the record - we buy opt in databases where we already have email addresses of people but its a good point - it didn't occur to me my post would come across like that!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP multi-dimensional array sorting issue aqw PHP 2 06-25-05 12:09 AM
php and ip address spidadesign PHP 0 05-16-05 06:05 PM
PHP email script problems (bounces go to wrong address). MTO PHP 1 04-29-04 12:13 AM


All times are GMT -5. The time now is 01:46 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.