RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Simple Email Registration

Miller.

Wanderer
Is there any way to make it delete the account after a time period (24 or 48 hours) if the email authorization hasn't taken place?
 

Draegen

Sorceror
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
 

Alex21

Sorceror
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

If all it contains is count os that would suggest that your EmailHolder.Emails dictionary does not contain any emails?, when you enter your email on login it will send you ten char confirm code, you have to use this code before you logout or the server shuts down, after using this code you will be added to EmailHolder.Emails, if you are not getting an email after entering it on login it might be a problem with your mail server.
 

Alex21

Sorceror
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

I don't know what gmail is but i use my remote mail server to run this script and it works, if that helps? :(
 

Miller.

Wanderer
It works great using my shard's mail server. I edited and am now testing using a Gmail account. Everything looks like it went through ok, but I haven't received the confirmation email yet. It's been about 5 minutes. I know Gmail is slow on the send/receive side of things, so that may be the cause. If I don't receive the confirmation email within the next half hour or so, I'll assume that smtp.gmail.com doesn't work properly.

EDITED: It's been about an hour and a half, no email from my Gmail account. I'll change it back to my shard's webhost mail server. I don't know why Gmail doesn't work, especially since it allows POP3 once activated.
 

Alex21

Sorceror
Does anyone using this have the problem where the accounts and emails registered to that account are mismatched?
 

Liacs

Sorceror
Oh, I totally missed this one when you released it. Looks very good. I am going to try it out.

Thanks for the submission!

Lia
 

doaker

Wanderer
Thanks I Been Looking For This For Some Time Good Job Ill Put It In ASAP ty


hmm well i dont know if it work with yahoo email either. it loads up but says Emails.xml failed at startup
 

.Lithium

Wanderer
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)
 

Alex21

Sorceror
.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)

Well from that you can tell the email address was not in the right form, how come? what did you do to enter an invalid email?
 

redsnow

Sorceror
This isnt working for me, can someone take a look and let me know why?
I know I'm doing something wrong.

I took out my personal information and put sample names in its place for posting.

Thanks

Code:
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;
 
Top