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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Including a date in the email subject

Status
Not open for further replies.

Lochbel

Technical User
Dec 5, 2002
125
AU
Running CE10.
I am emailing a txt file attachment each day to a client and would like either the current date (or the file date) to appear in the email subject....
e.g. ABCD 12th February 2005 CDEF

Any suggestions..

TIA

Lochbel
 
Here's a piece of code from destination.csp, modified to put the report name in the subject field. System date - at time of scheduling - is readily available as a built-in date function. I'm not sure how you'd split your ABCD and CDEF strings, and I don't know of any way you can get the run-time date into the subject.

Code:
// GETTING THE SUBJECT
var subject = Request.Form.Item("subject");
if(subject.Count == 0)
{
	if (!server_default)
	{
		// FORM DOESN'T HAVE IT. GET IT FROM THE OBJECT
		try 
		{
			subject = pi.Subject;
		} 
		catch (e) 
		{
			subject = "";
		}
	}
	else // Seed with our default value. v9 customization
		 // (substring strips the file extension; report long-name is not readily available) v9 customization
		subject = "OEFRS " + Title.substr(0,Title.length-4) + " Report"; // Add. v9 customization
} 
else 
{
	// ASSIGN TO THE OBJECT
	pi.Subject = subject;
}
 
As an alternative, you can select the placeholder of datetime to the filename at schedule time.

Supplies the required information without custom code.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top