WebfinityWorks Posted August 13, 2013 Share Posted August 13, 2013 Hello. I need help getting the date to submit in the email from this php form (http://www.cindys.com/awardreorder.php) I want the date to the be the first thing in the content of the email submitted. mail("cindys@cindys.com,phillipnshuey@yahoo.com,contact@webfinityworks.com","Awards Re-Order","{$_POST[date('r')]}|{$_POST['yearaward']}|{$_POST['entrynumber']}|{$_POST['organization']} |{$_POST['productiontitle']} |{$_POST['categoryname']} |{$_POST['skill']} |{$_POST['season']} |{$_POST['entertainment']} |{$_POST['entertainment_other']} |{$_POST['membeshiptype']} |{$_POST['shiping_name']}|{$_POST['shipping_address']}|{$_POST['shipping_city']}|{$_POST['shipping_state']}|{$_POST['shipping_mailcode']}|{$_POST['shipping_country']}|{$_POST['shipping_email']}|{$_POST['shipping_telephone']}| {$_POST['shipping_fax']}|{$_POST['shipping_address']}","From:no-reply@cindys.com\r\nReturn-Path:no-reply@cindys.com"); What am I doing wrong? Clearly I am a beginner in PHP. Thanks for the help in advance! Quote Link to comment Share on other sites More sharing options...
PravinS Posted August 13, 2013 Share Posted August 13, 2013 just use PHP date() function refer: http://php.net/manual/en/function.date.php Quote Link to comment Share on other sites More sharing options...
cyberRobot Posted August 13, 2013 Share Posted August 13, 2013 In addition to what PravinS said, the date() function needs to be outside of the quotes. <?php ..."Awards Re-Order", date('r') . "|{$_POST['yearaward']}|"... ?> Quote Link to comment Share on other sites More sharing options...
WebfinityWorks Posted August 14, 2013 Author Share Posted August 14, 2013 Okay cyber robot.. I can remove it from the quotes but will that keep it in message portion of the email? Quote Link to comment Share on other sites More sharing options...
WebfinityWorks Posted August 14, 2013 Author Share Posted August 14, 2013 (edited) I need the date to be the very first item that is read in the email message. As you can tell, I know very little about php. I've spent a lot of time reading over the site you suggested previous to posting. At this point, I'm at a loss and in need of help from the phpfreaks experts. Edited August 14, 2013 by WebfinityWorks Quote Link to comment Share on other sites More sharing options...
cyberRobot Posted August 14, 2013 Share Posted August 14, 2013 Okay cyber robot.. I can remove it from the quotes but will that keep it in message portion of the email? As long as the date() function is part of the third argument for mail(), it should appear in the message. The best way to determine if it works is to give it a try. Note: you'll probably want to send any tests to yourself instead of the people who typically receive the message. That way you can send out multiple messages without bothering other people. For future reference, I would recommend using variables to store the arguments for mail(). The code becomes much easier to follow. Examples 2 and 4 on the following page will show you what I mean: http://php.net/manual/en/function.mail.php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.