Re: [PHP] PHP Email Question
Hi I am trying the following snippet as Bostjan suggested, and an email is getting sent when I submit the form however in the body of the email I am getting none of the form data in the body of the email. All I am getting is the letter 'z' ? Also in the from field of the email this is showing as my email address and not the email address of the user who has sent the form Any ideas on where I am going wrong with this snippet? Any advice would be much appreciated $msgContent = Name: . $values['name'] .\n; $msgContent .= Address: . $values['address'] .\n; $msgContent .= Telephone: . $values['telephone'] .\n; $msgContent .= Email Address: . $values['emailaddress'] .\n; $msgContent .= Message: . $values['message'] .\n; function ProcessForm($values) { mail('myemail:domain.com', 'Website Enquiry', $msgContent, From: \{$values['name']}\ {$values['emailaddress']}); // Replace with actual page or redirect :P echo htmlheadtitleThank you!/title/headbodyThank you!/body/html;
[PHP] PHP Email Question
Hi Sorry for the simple question but I am trying to get my head around PHP. I have a sample PHP script that I am trying to use to send a php powered email message. The snippet of code is shown below mail('em...@address.com', 'Subject', $values['message'], From: \{$values['name']}\ {$values['emailaddress']}); This works fine, but how can I add in other fields to the email that is recieved? For example in the form there are fields called, 'emailaddress', 'telephone', 'address' and 'name' which I need to add into the form along with the message field Also with the formatting how can I change the format of the email to Name: $values['name'], Address: etc Message: TIA