Support

Kom i kontakt med vår kundtjänst, lär dig allt via vår SDK eller ladda ner den senaste uppdateringen.

Sending or Queueing mail from code?

2010-09-15 14:20:13 Paulo

Got some help from one of the Mindroute fellows with this one.

Example:

                MailService _mailService = ServiceLocator.Get<MailService>();

                MailMessage message = new MailMessage();
                message.From = new MailAddress("noreply@domain.com""Hello World");
                message.To.Add(new MailAddress(txtEpostadress.Text, ""));
                message.Bcc.Add(new MailAddress("recipient@otherdomain.com"""));

                message.Subject = "Hello World";
                message.Body = sbMail.ToString();
                message.IsBodyHtml = false;
                _mailService.Queue(message); // or _mailService.Send(message)

All replies

  • 2010-09-18 13:31:03 Magnus Krona

    Also make sure you have enabled the MailDaemon under Manage -> Daemons if you would like to queue mails.