lazerbrains Posted December 14, 2010 Share Posted December 14, 2010 I have an email form that is sending to an email address. There are five fields where the person sending can input their Name, Address, City, State, and Zip. Everything is working, except I want the input from these fields to be the the headers in the PHP email. For instance it submits and send the letter, but I want the senders Name, Address, City, State, and Zip to be posted after the "Sincerely" in the letter sent. Here is what the input boxes of the form looks like: <p>Sincerely,<br /> <label for="from">Name:</label> <input type="text" name="from" id="name" value="<?php echo $_POST['from'];?>"/><br /> <label for="street">Street:</label> <input type="text" name="street" id="street" value="<?php echo $_POST['street'];?>"/><br /> <label for="city">City:</label> <input type="text" name="city" id="city" value="<?php echo $_POST['city'];?>"/><br /> <label for="zip">Zip:</label> <input type="text" name="zip" id="zip" value="<?php echo $_POST['zip'];?>"/><br /> <label for="email">E-mail:</label> <input type="text" name="email" id="email" value="<?php echo $_POST['email'];?>"/></p> <input type="submit" class="button" value="Submit" /> How do I go about posting the PHP headers in the email upon submission? Link to comment https://forums.phpfreaks.com/topic/221659-php-mail-headers-from-input-fields/ Share on other sites More sharing options...
lazerbrains Posted December 14, 2010 Author Share Posted December 14, 2010 For instance how would I pass the "from" field into this header? $headers = "From: "; I need the Name that the person enters in the Name input box to go to the header, and I am not sure of the syntax. Link to comment https://forums.phpfreaks.com/topic/221659-php-mail-headers-from-input-fields/#findComment-1147297 Share on other sites More sharing options...
jdavidbakr Posted December 14, 2010 Share Posted December 14, 2010 If you're using the mail() command, it's just the 4th parameter: http://us2.php.net/manual/en/function.mail.php Link to comment https://forums.phpfreaks.com/topic/221659-php-mail-headers-from-input-fields/#findComment-1147348 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.