Beispiel #1
0
        /// <inheritdoc/>
        public void SendVerificationToken(TokenInfoDto verificationTokenInfo)
        {
            string       name                = verificationTokenInfo.Name;
            string       emailAddress        = verificationTokenInfo.EmailAddress;
            string       verificationToken   = verificationTokenInfo.Token;
            string       subjectOfTheMessage = verificationTokenInfo.Subject;
            string       bodyOfTheMessage    = verificationTokenInfo.Body;
            MailTemplate mt = new MailTemplate();

            mt.SetReceiver(name, emailAddress);
            mt.SetMessage(subjectOfTheMessage, bodyOfTheMessage + ": " + verificationToken);
            try
            {
                mt.Send();
            }
            catch (SocketException socketException)
            {
                _logger.Fatal("MailingService.cs: An error related to the socket occured while " +
                              "trying to send the email. Check the credentials for " +
                              "sending the email. Method Send, line 40", socketException);
            }
            catch (ProtocolException protocolException)
            {
                _logger.Fatal("MailingService.cs: An error related with the protocol occured while " +
                              "trying to send the email. Check that you are using a valid " +
                              "protocol for sending the emails.", protocolException);
            }
        }
        private void SendEmail()
        {
            MailTemplate mt = new MailTemplate();

            mt.SetReceiver(TextBoxName.Text + " " + TextBoxLastName.Text, TextBoxEMail.Text);
            mt.SetMessage("Contraseña de SCPP", "Profesor con el numero de trabajador: " + TextBoxWorkerNumber.Text + ", tu contraseña para el SCPP es: " + password);
            try
            {
                mt.Send();
            }
            catch (Exception)
            {
            }
        }
        private void SendEmail()
        {
            MailTemplate mt = new MailTemplate();

            mt.SetReceiver(TextBoxNombre.Text + " " + TextBoxApellidoPaterno.Text, TextBoxCorreo.Text);
            mt.SetMessage("Contraseña de de SCPP", "Estudiante con matricula " + TextBoxMatricula.Text + ", tu contraseña para el SCPP es: " + TextBoxContraseña.Password);
            try
            {
                mt.Send();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }