aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs27
1 files changed, 16 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs
index 9e2abf2..43eccf3 100644
--- a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs
@@ -178,17 +178,15 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules
178 } 178 }
179 179
180 /// <summary> 180 /// <summary>
181 /// 181 /// Delay function using thread in seconds
182 /// </summary> 182 /// </summary>
183 /// <param name="seconds"></param> 183 /// <param name="seconds"></param>
184 private void DelayInSeconds(int seconds) 184 private void DelayInSeconds(int delay)
185 { 185 {
186 TimeSpan DiffDelay = new TimeSpan(0, 0, seconds); 186 delay = (int)((float)delay * 1000);
187 DateTime EndDelay = DateTime.Now.Add(DiffDelay); 187 if (delay == 0)
188 while (DateTime.Now < EndDelay) 188 return;
189 { 189 System.Threading.Thread.Sleep(delay);
190 ;//Do nothing!!
191 }
192 } 190 }
193 191
194 private bool IsLocal(UUID objectID) 192 private bool IsLocal(UUID objectID)
@@ -293,12 +291,19 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules
293 "\nRegion: " + LastObjectRegionName + "\nLocal-Position: " + 291 "\nRegion: " + LastObjectRegionName + "\nLocal-Position: " +
294 LastObjectPosition + "\n\n" + body; 292 LastObjectPosition + "\n\n" + body;
295 293
294 //Config SMTP Server
296 //Set SMTP SERVER config 295 //Set SMTP SERVER config
297 SmtpServer smtpServer = new SmtpServer(SMTP_SERVER_HOSTNAME, SMTP_SERVER_PORT); 296 SmtpServer smtpServer=new SmtpServer(SMTP_SERVER_HOSTNAME,SMTP_SERVER_PORT);
298 //Authentication 297 // Add authentication only when requested
299 smtpServer.SmtpAuthToken = new SmtpAuthToken(SMTP_SERVER_LOGIN, SMTP_SERVER_PASSWORD); 298 //
299 if (SMTP_SERVER_LOGIN != String.Empty && SMTP_SERVER_PASSWORD != String.Empty)
300 {
301 //Authentication
302 smtpServer.SmtpAuthToken=new SmtpAuthToken(SMTP_SERVER_LOGIN, SMTP_SERVER_PASSWORD);
303 }
300 //Send Email Message 304 //Send Email Message
301 emailMessage.Send(smtpServer); 305 emailMessage.Send(smtpServer);
306
302 //Log 307 //Log
303 m_log.Info("[EMAIL] EMail sent to: " + address + " from object: " + objectID.ToString()); 308 m_log.Info("[EMAIL] EMail sent to: " + address + " from object: " + objectID.ToString());
304 } 309 }