Beispiel #1
0
        static public void sendTemplateMailLogError(String stacktrace, String message)
        {
            InfosMailling mail = new InfosMailling();

            mail.toPeople.Add(MANAHOST_EMAIL);
            mail.subject = "Error Manahost";
            mail.body    = "An error occured : </br></br>message error : " + message + "</br></br>stacktrace error : " + stacktrace;
            mail.prio    = MailPriority.High;
            Mailling.sendMail(mail, null);
        }
Beispiel #2
0
        static public void sendTemplateMailWarningConnection(String locale, String civility, String firstname, String lastname, String email)
        {
            InfosMailling mail = new InfosMailling();
            String        forgotPasswordLink = String.Format(FORGOT_LINK_FORMAT, email);

            ManahostManager.Utils.MailingUtils.Resources.MailTemplate.Culture = Thread.CurrentThread.CurrentCulture;

            mail.toPeople.Add(email);
            mail.subject = ManahostManager.Utils.MailingUtils.Resources.MailTemplate.SubjectConnectionWarning;
            mail.body    = String.Format(ManahostManager.Utils.MailingUtils.Resources.MailTemplate.BodyConnectionWarning, civility, firstname, lastname, forgotPasswordLink);
            mail.body   += ManahostManager.Utils.MailingUtils.Resources.MailTemplate.Footer;
            mail.prio    = MailPriority.Normal;
            Mailling.sendMail(mail, null);
        }
Beispiel #3
0
        public void SendOneMailServerWithoutPasswordShouldWork()
        {
            InfosMailling info = new InfosMailling();

            info.toPeople.Add("*****@*****.**");
            info.subject = "subject";
            info.prio    = MailPriority.High;
            info.ssl     = false;
            info.modifyTimeOut(200000);
            MailLog log = new MailLog();

            Mailling.sendMail(info, log);
            Assert.AreEqual(1, _Server.ReceivedEmailCount);
        }
Beispiel #4
0
        static public void sendTemplateMailCreationAccount(String locale, String firstname, String lastName, String civility, String email, String tokenActivation)
        {
            InfosMailling mail               = new InfosMailling();
            String        activationLink     = String.Format(ACTIVATION_LINK_FORMAT, email, tokenActivation);
            String        forgotPasswordLink = String.Format(FORGOT_LINK_FORMAT, email);

            mail.toPeople.Add(email);
            //Thread.CurrentThread.CurrentUICulture = new CultureInfo(locale);
            ManahostManager.Utils.MailingUtils.Resources.MailTemplate.Culture = Thread.CurrentThread.CurrentCulture;
            mail.subject = ManahostManager.Utils.MailingUtils.Resources.MailTemplate.SubjectAccountCreation;
            mail.body    = String.Format(ManahostManager.Utils.MailingUtils.Resources.MailTemplate.BodyAccountCreation, civility, firstname, lastName, activationLink, email, forgotPasswordLink);
            mail.body   += ManahostManager.Utils.MailingUtils.Resources.MailTemplate.Footer;
            mail.prio    = MailPriority.Normal;
            Mailling.sendMail(mail, null);
        }
Beispiel #5
0
        private void SendMail(InfosMailling mail, MailLog log, BookingStepBooking b, bool ssl, String body, List <Attachment> attachments)
        {
            mail.toPeople.Add(b.Booking.People.Email);
            mail.ssl     = ssl;
            mail.prio    = System.Net.Mail.MailPriority.High;
            mail.subject = b.CurrentStep.MailSubject;
            //TODO transform mail body template with the template generator
            mail.body        = body;
            mail.attachments = attachments;
            Mailling.sendMail(mail, log);

            log.HomeId = b.HomeId;
            b.MailLog  = log;
            if (b.MailLog.Successful)
            {
                b.MailSent++;
            }
        }