Jump to content

Archived

This topic is now archived and is closed to further replies.

fogofogo

problems with email

Recommended Posts

Hello all,

I have some code below that creates an email from a web form :

[code]<?php
// create the email message

$msg .= "Please create this account and credit it with $10 \n\n\n";

$msg .= "ACCOUNT DETAILS \n\n";

if ($nickname != "") {
     $msg .= "Nick Name : $nickname\n";
     }
if ($username != "") {
     $msg .= "User Name : $username\n";
     }
if ($password != "") {
     $msg .= "Password : $password\n\n";
     }
$msg .= "Personal DETAILS \n\n";

if ($from != "") {
     $msg .= "First Name : $from\n";
     }
if ($middlename != "") {
     $msg .= "Middle Name : $middlename\n";
     }
if ($lastname != "") {
     $msg .= "Last Name : $lastname\n";
     }
if ($dateofbirth != "") {
     $msg .= "Date of Birth : $dateofbirth\n";
     }
$msg .= "Address : $address\n";

if ($town != "") {
     $msg .= "Town : $town\n";
     }
if ($postcode != "") {
     $msg .= "Postcode : $postcode\n";
     }
if ($county != "") {
     $msg .= "County : $county\n";
     }
if ($country != "") {
     $msg .= "Country : $country\n";
     }
if ($telephone != "") {
     $msg .= "Telephone : $telephone\n";
     }
if ($email != "") {
     $msg .= "Email : $email\n";
     }

if ($bigslickprivate != "") {
     $msg .= "Join the Big Slick Private Members club? : $bigslickprivate\n";
     }
if ($bigslickplayers != "") {
     $msg .= "Join the Big Slick Players Club? : $bigslickplayers\n";
     }
if ($bigslickpreffered != "") {
     $msg .= "Obtain membership to Big Slick's preferred members club? : $bigslickpreffered\n\n";
     }
$msg .= "Sent : $today\n";

$mailheaders = "Poker account registration ( $username ) \n";

$mailheaders = "From: $email";


mail($to, $subject, $msg, $mailheaders);[/code]


I am trying to have the users email address (the person who has just filled out the form) appear in the "from" field, but the webserver seems to fill in its own address.

here is how I have the from address set up :

[code]$mailheaders = "From: $email"; [/code]

the $email variable is populated from a form field. Any Ideas how to do this?

Thanks:

[b]EDITED BY WILDTEEN: PLEASE USE THE CODE TAGS RATHER THAN THE PHP TAGS AS THE PHP TAGS NO LONGER EXIST. THANK YOU[/b]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.