コード例 #1
0
    private void SendSubmitMail()
    {
        MailDefinition def = new MailDefinition();

        def.IsBodyHtml   = true;
        def.BodyFileName = "~/mail-templates/submit-club.html";
        def.Subject      = "RC Map - Club Submitted";
        MailUtility.Send(def.CreateMailMessage(Configuration.EmailsTo, GetTemplateReplacements(), this));
    }
コード例 #2
0
        /// <summary>
        /// Sends a mail message to the task notification address.
        /// </summary>
        /// <param name="subject">The message subject.</param>
        /// <param name="body">The message body.</param>
        /// <param name="isBodyHtml">True if the body is HTML, otherwise; false.</param>
        protected void SendMailMessage(string subject, string body, bool isBodyHtml)
        {
            if (subject == null || body == null)
            {
                throw Error.ArgumentNull(subject == null ? "subject" : "body");
            }

            MailMessage message = new MailMessage();

            message.Subject    = subject;
            message.Body       = body;
            message.IsBodyHtml = isBodyHtml;
            message.To.Add(this.TaskNotificationAddress);

            MailUtility.Send(message);
        }
コード例 #3
0
        public void Register(UserRegisterCommand command)
        {
            var user = new User(
                new UserName(command.Name)
                );

            if (userService.Exists(user))
            {
                throw new CanNotRegisterUserException(user, "이미 등록된 사용자임");
            }

            userRepository.Save(user);

            if (sendMail)
            {
                MailUtility.Send("user registered");
            }
        }