How to send email messages asynchronously?
Sending email messages asynchronously is a convenient way to send notifications to the entities with which organizations relate in the course of their business activity. To be able to use this functionality, you must have PRIMAVERA Scheduler Service installed. The scheduler service is the part that will be responsible for monitoring the status of messages and sending them, for which purpose it is necessary to configure the SMTP server at the end of the installation of this service. The messages to be sent are stored in the MessagesEmail table in the PRIEMPRE database. After successful processing they are marked as sent (Sent field) so that they are not available again. To register the sending of a new email message you must use the Email service provided by the platform as shown in the example below.using StdPlatBE100;
using StdPlatBS100;
using System;
namespace Email
{
public class MensagensAssincronas
{
public void EnviaMensagem()
{
StdPlatBE100.StdBEMensagemEmail bEMensagemEmail = new StdPlatBE100.StdBEMensagemEmail();
bEMensagemEmail.Assunto= "Exemplo de Envio";
bEMensagemEmail.EmailTo = "[email protected]";
bEMensagemEmail.Data = DateTime.Now;
bEMensagemEmail.Anexos = null;
bEMensagemEmail.Mensagem = "Este é um exemplo de envio de mensagens de forma assincrona.";
PSO.Email.Actualiza(bEMensagemEmail);
}
}
}
login para deixar a sua opinião.