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 Type | Function name | Arguments |
|---|---|---|
| bool | GenerateMailId | (hzString&,) |
Declared and defined in file: hzMailer.cpp
Function Logic:
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 ;
}