Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cron to e-mail date and time in subject 1

Status
Not open for further replies.

Geronantimo

Technical User
Apr 3, 2006
79
SE
I am trying to write a very simple php script that can send an e-mail with the date and time in the subject line.

I have tried this:

Code:
<?php
     mail("cron@domain.net","hello",x);
?>

and this works fine - "hello" is in the subject line and "x" in the body of the e-mail.

When I try to echo the date into the subject line, I cannot get it to work.

Is it possible to achieve what I am trying to achieve?
 
Code:
$subject="hello" . date("D M d Y");

mail("cron@domain.net",$subject,"x");

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Hi vacunita,

Thank you so much. Can you tell that I am a bit of a beginner?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top