Draegen;752700 said:it writes they email.xml file but it only has this lines in it
count 0
Here is my emailclient.cs setup maybe im doing something wrong
public static bool Enabled = true; // Is this system enabled?
public static string ServerName = "Distant Land"; // Your server name here.
public static string EmailServer = "smtp.gmail.com"; // Your mail server here
public static string User = "[email protected]"; // Your username here
public static string Pass = "******"; // Your password here
public static string YourAddress = "[email protected]"; // Your email address here, Or Shard name
// Server will crash on start up if the adress is incorrectly formatted.
I checked Gmail does allow POP3
Draegen;752829 said:my question is do i have to have any mail server on my pc or just use g-mail mail server??? for my pop3
Aurboda;777859 said:not sure if it is bug free, but using it without any crashes
Aurboda;777859 said:not sure if it is bug free, but using it without any crashes
Server Crash Report
===================
RunUO Version 2.0, Build 3339.39459
Operating System: Microsoft Windows NT 5.2.3790 Service Pack 2
.NET Framework: 2.0.50727.42
Time: 27.03.2009 19:52:15
Mobiles: 49912
Items: 216244
Exception:
System.FormatException: The specified string is not in the form required for an e-mail address.
at System.Net.Mime.MailBnfHelper.ReadMailAddress(String data, Int32& offset, String& displayName)
at System.Net.Mime.MailBnfHelper.ReadMailAddress(String data, Int32& offset)
at System.Net.Mail.MailAddressCollection.ParseValue(String addresses)
at System.Net.Mail.MailAddressCollection.Add(String addresses)
at Server.Misc.RegisterEmailClient.SendSingal(Object e)
at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)
.Lithium;795152 said:Code:Server Crash Report =================== RunUO Version 2.0, Build 3339.39459 Operating System: Microsoft Windows NT 5.2.3790 Service Pack 2 .NET Framework: 2.0.50727.42 Time: 27.03.2009 19:52:15 Mobiles: 49912 Items: 216244 Exception: System.FormatException: The specified string is not in the form required for an e-mail address. at System.Net.Mime.MailBnfHelper.ReadMailAddress(String data, Int32& offset, String& displayName) at System.Net.Mime.MailBnfHelper.ReadMailAddress(String data, Int32& offset) at System.Net.Mail.MailAddressCollection.ParseValue(String addresses) at System.Net.Mail.MailAddressCollection.Add(String addresses) at Server.Misc.RegisterEmailClient.SendSingal(Object e) at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)
.Lithium;795192 said:I really don't know. My players did it ...
public static bool Enabled = true; // Is this system enabled?
public static string ServerName = "SHARDNAME"; // Your server name here.
public static string EmailServer = "yahoo.com"; // Your mail server here
public static string User = "sample"; // Your username here
public static string Pass = "PW"; // Your password here
public static string YourAddress = "[email protected]"; // Your email address here, Or Shard name
// Server will crash on start up if the adress is incorrectly formatted.
public static SmtpClient client;
public static MailMessage mm;
public static void Initialize()
{
if (Enabled)
{
client = new SmtpClient(EmailServer);
client.Credentials = new NetworkCredential(User, Pass);
mm = new MailMessage();
mm.Subject = ServerName;
mm.From = new MailAddress(YourAddress);
}
}
public static void SendMail(EmailEventArgs e)
{
bool single = e.Single;
if (single)
{
ThreadPool.QueueUserWorkItem(new WaitCallback(SendSingal), e);
}
else
{
ThreadPool.QueueUserWorkItem(new WaitCallback(SendMultiple), e);
}
return;
}
private static void SendMultiple(object e)
{
EmailEventArgs eea = (EmailEventArgs)e;
List<MailAddress> emails = (List<MailAddress>)eea.Emails;
string sub = (string)eea.Subject;
string msg = (string)eea.Message;
for (int i = 0; i < emails.Count; ++i)
{
MailAddress ma = (MailAddress)emails[i];
mm.To.Add(ma);
}
mm.Subject += " - " + sub;
mm.Body = msg;
try
{
client.Send(mm);
}
catch { }
mm.To.Clear();
mm.Body = "";
mm.Subject = ServerName;
return;
}
private static void SendSingal(object e)
{
EmailEventArgs eea = (EmailEventArgs)e;
string to = (string)eea.To;
string sub = (string)eea.Subject;
string msg = (string)eea.Message;
mm.To.Add(to);
mm.Subject += " " + sub;
mm.Body = msg;
try
{
client.Send(mm);
}
catch { }
mm.To.Clear();
mm.Body = "";
mm.Subject = ServerName;
return;
}
}
public class EmailEventArgs
{
public bool Single;
public List<MailAddress> Emails;
public string To;
public string Subject;
public string Message;
public EmailEventArgs(bool single, List<MailAddress> list, string to, string sub, string msg)
{
Single = single;
Emails = list;
To = to;
Subject = sub;
Message = msg;