Exemplo n.º 1
0
        /// <summary>
        /// Email the error to technical support
        /// </summary>
        /// <returns></returns>
        private bool SendError()
        {
            string      body;
            string      subject     = "Error in " + myErrorInformation.ProgramName;
            string      attachments = string.Empty;
            EmailEngine email       = new EmailEngine();


            try
            {
                ValidateChildren();

                if (epValidation.GetError(txtSteps).Length == 0)
                {
                    //Send using mailto link if there is no smtp server specified
                    if (myErrorInformation.SmtpServer == string.Empty)
                    {
                        TryLink(myErrorInformation.GetManualEmailMessage());

                        return(true);
                    }

                    //Send using smtp server
                    email.ServerName         = myErrorInformation.SmtpServer;
                    myErrorInformation.Steps = txtSteps.Text;
                    body         = myErrorInformation.GetXMLMessage();
                    attachments += myErrorInformation.ScreenShot + ",";
                    attachments += myErrorInformation.EventLogText + ",";

                    email.SendMail(myErrorInformation.Email, myErrorInformation.SupportEmail, subject, body, attachments);
                    return(true);
                }

                MessageBox.Show(this, epValidation.GetError(txtSteps), "Errors on Screen", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(false);
            }
            catch (Exception ex)
            {
                //Smtp server send failed, send with a mailto link
                GuiException.HandleException(ex);
                TryLink(myErrorInformation.GetManualEmailMessage());
                return(false);
            }
        }
Exemplo n.º 2
0
        private void SendRegistrationAlert(string UserName, string Email)
        {
            string body = PopulateMailBody(UserName, Email);

            EmailEngine.SendMail(Email, "Welcome to ABC HRMS.", body);
        }
Exemplo n.º 3
0
        private void SendRegistrationAlert(string UserName, string amt, string mn, string yr)
        {
            string body = PopulateMailBody(UserName, amt, mn, yr);

            EmailEngine.SendMail(UserName, "Welcome to ABC HRMS.", body);
        }