//        public void SendEmailWithAttachment(string fromEmail, string toEmail, string ccEmail, string emailSubject, string emailBody, Stream attachment, string attachmentFilename)
        public void SendEmailWithAttachment(EmailRequest request)
        {
            SMTPClient emailClient = new SMTPClient();

            try
            {
                EmailHelper emailHelper = new EmailHelper(emailClient);
                emailHelper.SendMail(request.FromEmail, request.ToEmail, request.CcEmail, request.EmailSubject, request.EmailBody, request.Attachment, request.AttachmentFilename);
            }

            catch (Exception ex)
            {
                /*log error locally */
                string message = string.Format(
                    "Error in  public void SendEmail(string fromEmail:{0}, string toEmail:{1}, string ccEmail:{2}, string emailSubject:{3}, string emailBody:{4}); string attachment filename: {6}; Detailed exception:{5}",
                    request.FromEmail, request.ToEmail, request.CcEmail, request.EmailSubject, request.EmailBody, ex.ToString(), request.AttachmentFilename);
                Exception custom = new Exception(message);
                ExceptionManager.HandleException(custom);

                ServiceErrorFault fault = new ServiceErrorFault();
                fault.Operation   = "Send Email";
                fault.ProblemType = "Error sending email";

                throw new FaultException <ServiceErrorFault>(fault);
            }
        }
        public void SendEmail(string fromEmail, string toEmail, string ccEmail, string emailSubject, string emailBody)
        {
            SMTPClient emailClient = new SMTPClient();

            try
            {
                EmailHelper emailHelper = new EmailHelper(emailClient);
                emailHelper.SendMail(fromEmail, toEmail, ccEmail, emailSubject, emailBody);
            }

            catch (Exception ex)
            {
                /*log erorr locally */
                string message = string.Format("Error in  public void SendEmail(string fromEmail:{0}, string toEmail:{1}, string ccEmail:{2}, string emailSubject:{3}, string emailBody:{4}); Detailed exception:{5}",
                                               fromEmail, toEmail, ccEmail, emailSubject, emailBody, ex.ToString());
                Exception custom = new Exception(message);
                ExceptionManager.HandleException(custom);

                ServiceErrorFault fault = new ServiceErrorFault();
                fault.Operation   = "Send Email";
                fault.ProblemType = "Error sending email";

                throw new FaultException <ServiceErrorFault>(fault);
            }
        }