Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 



Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > Design Forum > Web Design & Programming
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Web Design & Programming Discussion of web design, and server-side & client-side scripting

Reply
 
LinkBack Thread Tools
Old 09-03-2007, 03:35 AM   #1 (permalink)
TSF Enthusiast
 
KoosHopeloos's Avatar
 
Join Date: Nov 2004
Posts: 555
OS: Windows XP Pro & Windows Vista Ultimate browsing the web with FF, Opera, Safari and IE.


Mailform: how to put e-mail input as 'from' e-mailaddress?

L.S.,

I'm using a php-script to receive e-mails from my website. At the moment, everything (name, e-mail, and message) is coming in the message of the e-mail send in which 'httpd' is used a the sender' e-mailaddress.

Is there a way to automatically use the e-mailaddress that users fill in the contactform as the senders address in the e-mail I receive?

Contactform can be found here

Php-script used here:

Code:
<?
  $Naam = $_REQUEST['Naam'] ;
  $Email = $_REQUEST['Email'] ;
  $Bericht = $_REQUEST['Bericht'] ;

  if (!isset($_REQUEST['Email'])) {
    header( "Location: http://www.kleurenblindheid.nl/kleuren/contact.html" );
  }
  elseif (empty($Naam) || empty($Email) || empty($Bericht)) {
    ?>

    <html>
    <head><title>Foutje?</title></head>
    <body>
    <h1>Foutje</h1>
    <p>
    Naam vergeten? Email adres vergeten? Geen bericht ingevuld? Ga terug met de 'TERUG'-knop en probeer het nogmaals! 
    </p>
    </body>
    </html>

    <?
  }
  else {
    mail( "contact@kleurenblindheid.nl", "Contact Formulier",
          $Naam, $Bericht, "From: $Email" );
    header( "Location: http://www.kleurenblindheid.nl/kleuren/contact2.html" );
  }
?>

Thanks for the help!
__________________
KoosHopeloos, straight to you from .nl via the world wide web!

KoosHopeloos is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here

Old 09-03-2007, 02:26 PM   #2 (permalink)
Design Team Member
 
Redcore's Avatar
 
Join Date: Aug 2007
Location: Jamestown, CA
Posts: 715
OS: Linux Mint 7

My System

Re: Mailform: how to put e-mail input as 'from' e-mailaddress?

PHP Code:
    mail"contact@kleurenblindheid.nl""Contact Formulier",
          
$Naam$Bericht"From: $Email" ); 
I'm assuming $Bericht means message, right?

It looks like it's in the wrong place...this is the setup of the mail function:
PHP Code:
mail($to$subject$message$additional_headers$additional_parameters
So your "From: $Email" is in the "$additional_parameters" field.

Try this out and see if it works out for you:
PHP Code:
$message $Naam $Bericht;
mail("contact@kleurenblindheid.nl""Contact Formulier"$message"From: $Email" ); 
Redcore is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 09-07-2007, 02:50 PM   #3 (permalink)
TSF Enthusiast
 
KoosHopeloos's Avatar
 
Join Date: Nov 2004
Posts: 555
OS: Windows XP Pro & Windows Vista Ultimate browsing the web with FF, Opera, Safari and IE.


Re: Mailform: how to put e-mail input as 'from' e-mailaddress?

@ Redcore: Thanks helping a PHP-newbie, I now have the e-mailaddress the user filled in a the sender e-mailaddress! One final question though: the name and message (yes, that is the translation of Bericht ;)) are now directly behind each other without spaces. Can it be done like this:
-----
Name
-Blank line-
Message (Bericht)
-----

Thanks again!

Greetz,
__________________
KoosHopeloos, straight to you from .nl via the world wide web!

KoosHopeloos is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 09-08-2007, 03:06 AM   #4 (permalink)
Design Team Member
 
Redcore's Avatar
 
Join Date: Aug 2007
Location: Jamestown, CA
Posts: 715
OS: Linux Mint 7

My System

Re: Mailform: how to put e-mail input as 'from' e-mailaddress?

Sure can...I should have wrote it with that to begin with really.

PHP Code:
$message $Naam "<br><br>" $Bericht;
mail("contact@kleurenblindheid.nl""Contact Formulier"$message"From: $Email" ); 
Redcore is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 09-08-2007, 12:52 PM   #5 (permalink)
TSF Enthusiast
 
KoosHopeloos's Avatar
 
Join Date: Nov 2004
Posts: 555
OS: Windows XP Pro & Windows Vista Ultimate browsing the web with FF, Opera, Safari and IE.


Re: Mailform: how to put e-mail input as 'from' e-mailaddress?

@ Redcore: thanks a lot again! Didn't expect it to be so easy... Tried a couple of things, but not this.
__________________
KoosHopeloos, straight to you from .nl via the world wide web!

KoosHopeloos is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 09-09-2007, 12:15 AM   #6 (permalink)
Design Team Member
 
Redcore's Avatar
 
Join Date: Aug 2007
Location: Jamestown, CA
Posts: 715
OS: Linux Mint 7

My System

Re: Mailform: how to put e-mail input as 'from' e-mailaddress?

Don't I know it! Programming is very much trial & error, especially if you're still new. I break code at least 70% of the time - I had to learn pretty quickly that it's broken because I did something wrong, not because it's stupid or just won't do it HAHA! I've cussed out my monitor many times - and then felt really stupid when I realized that I simply misspelled a critical word or variable. :P
Redcore is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 09-09-2007, 03:40 AM   #7 (permalink)
Design Team Member
 
Redcore's Avatar
 
Join Date: Aug 2007
Location: Jamestown, CA
Posts: 715
OS: Linux Mint 7

My System

Re: Mailform: how to put e-mail input as 'from' e-mailaddress?

WOOPS...

I just realized I put HTML in that update ... not the PHP one.

PHP Code:
$message $Naam "\n\n" $Bericht;
mail("contact@kleurenblindheid.nl""Contact Formulier"$message"From: $Email" ); 
LOL otherwise it'll say "Name<BR><BR>Message..."

Sorry about that! Just wasn't paying attention :P
Redcore is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 09-09-2007, 09:16 AM   #8 (permalink)
TSF Enthusiast
 
KoosHopeloos's Avatar
 
Join Date: Nov 2004
Posts: 555
OS: Windows XP Pro & Windows Vista Ultimate browsing the web with FF, Opera, Safari and IE.


Re: Mailform: how to put e-mail input as 'from' e-mailaddress?

@ Redcore: Can happen! Thanks again!
__________________
KoosHopeloos, straight to you from .nl via the world wide web!

KoosHopeloos is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -7. The time now is 12:46 AM.



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85