change time to send the query

master
Christopher 2020-07-01 21:49:54 +02:00
parent 8a89d5968e
commit 7d2c3bbba4
1 changed files with 15 additions and 12 deletions

View File

@ -78,7 +78,7 @@ namespace OpenSim.Modules.EMail
m_scene = scene;
m_timer_send = new Timer();
m_timer_send.Interval = 1000 * 10;
m_timer_send.Interval = 1000 * 3;
m_timer_send.Elapsed += sendAllMails;
m_timer_send.Enabled = true;
m_timer_send.Start();
@ -304,26 +304,29 @@ namespace OpenSim.Modules.EMail
public void SendEmail(UUID objectID, string address, string subject, string body)
{
SceneObjectPart sceneObject = m_scene.GetSceneObjectPart(objectID);
try
{
SceneObjectPart sceneObject = m_scene.GetSceneObjectPart(objectID);
lock(m_sendMessages)
{
MimeMessage message = new MimeMessage();
message.From.Add(new MailboxAddress(sceneObject.Name, sceneObject.UUID + "@" + SMTP_SERVER_SENDER));
message.To.Add(new MailboxAddress("", address));
message.Subject = subject;
message.Body = new TextPart("plain") { Text = body };
MimeMessage message = new MimeMessage();
message.From.Add(new MailboxAddress(sceneObject.Name, sceneObject.UUID + "@" + SMTP_SERVER_SENDER));
message.To.Add(new MailboxAddress("", address));
message.Subject = subject;
message.Body = new TextPart("plain") { Text = body };
message.Headers.Add(new Header(Encoding.UTF8, "ObjectID", sceneObject.UUID.ToString()));
message.Headers.Add(new Header(Encoding.UTF8, "AvatarID", sceneObject.OwnerID.ToString()));
message.Headers.Add(new Header(Encoding.UTF8, "Location", m_scene.Name + "@" + sceneObject.GetWorldPosition().ToString()));
message.Headers.Add(new Header(Encoding.UTF8, "ObjectID", sceneObject.UUID.ToString()));
message.Headers.Add(new Header(Encoding.UTF8, "AvatarID", sceneObject.OwnerID.ToString()));
message.Headers.Add(new Header(Encoding.UTF8, "Location", m_scene.Name + "@" + sceneObject.GetWorldPosition().ToString()));
m_sendMessages.Add(message);
}
m_sendMessages.Add(message);
}catch(Exception _error)
{
m_log.Error("[" + Name + "] " + _error.Message);
}
}
public Email GetNextEmail(UUID objectID, string sender, string subject)