Purpose: Generate a unique mail id for sending out emails. The mail id will be of the form:- YYYYMMDDHHMMSS.pid.email_system_name@hostname. The default for email_system_name is 'hadronzoo-mailer'.

Return TypeFunction nameArguments
boolGenerateMailId(hzString&,)

Declared and defined in file: hzMailer.cpp

Function Logic:

0:START 1:unknown 2:s_EmailSystem 3:items items MailId 4:Return MailId?true:false

Function body:

bool GenerateMailId (hzString& MailId)
{
   //  Category: Mailer
   //  
   //  Purpose: Generate a unique mail id for sending out emails. The mail id will be of the form:-
   //      YYYYMMDDHHMMSS.pid.email_system_name@hostname.
   //     The default for email_system_name is 'hadronzoo-mailer'.
   //  
   //  Arguments: 1) MailId Unique Mail Id supplied as a string
   //  
   //  Returns: True If operation successful
   //     False Otherwise
   hzChain Z ;     //  Working chain buffer
   hzXDate d ;     //  Current system time and date stamp
   if (!s_EmailSystem)
       s_EmailSystem = "hadronzoo-mailer" ;
   d.SysDateTime() ;
   Z.Printf("%04d%02d%02d%02d%02d%02d.%d.%s@%s",
       d.Year(), d.Month(), d.Day(), d.Hour(), d.Min(), d.Sec(), getpid(), *s_EmailSystem, *_hzGlobal_Hostname) ;
   MailId = Z ;
   return MailId ? true : false ;
}