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("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! :)

 

 

 

 

Link to comment
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. :)

Edited by WebfinityWorks
Link to comment
Share on other sites

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

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.