To make life easier for us all.
If I construct a generic email method, I will construct it with a number of overloads:
public static void Email(string body)
public static void Email(string body,
params MailAttachment[] attachments)
public static void Email(string to, string body)
public static void Email(string to,
string body,
params MailAttachment[] attachments)
public static void Email(string to,
string body,
string subject)
public static void Email(string to,
string body,
string subject,
params MailAttachment[] attachments)
public static void Email(string to,
string body,
string subject,
string fromAddress)
public static void Email(string to,
string body,
string subject,
string fromAddress,
params MailAttachment[] attachments)
public static void Email(string to,
string body,
string subject,
string fromAddress,
string fromDisplay,
params MailAttachment[] attachments)
public static void Email(string to,
string body,
string subject,
string fromAddress,
string fromDisplay,
string credentialUser,
string credentialPassword,
params MailAttachment[] attachments)
And these will all eventually call the final one, which will do the actual job. All the others just "fill in the blanks" with appropriate defaults, or prepare suitable parameters.
In the old days, I would have had to construct nine different routines, all with different names such as "EmailToBodySubjectFromaddressWithAttachments", and then try desperately to remember which had which parameters, or how to construct the relevant defaults. This way, I have to remember one name: "Email" and the system will help me fill in the blanks.
Much easier for me, and a whole lot more reliable to boot!