Jump to content

problems with email


fogofogo

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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.