Jump to content

Help with Date in PHP Email Code


WebfinityWorks

Recommended Posts

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("[email protected],[email protected],[email protected]","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:[email protected]\r\nReturn-Path:[email protected]");

 

What am I doing wrong? Clearly I am a beginner in PHP. Thanks for the help in advance! :)

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/281110-help-with-date-in-php-email-code/
Share on other sites

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. :)

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

Archived

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

×
×
  • 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.