This project is read-only.

demoapp don't work with alibaba.com

Jan 19, 2013 at 7:02 AM
Edited Jan 19, 2013 at 7:03 AM

i have a email of alibaba,and  i run the demo ,but it don't work

server :imap.alibaba.com

port:143

Jan 19, 2013 at 11:44 AM

sorry,it work when i change one line code:

private ImapClient CreateClientByAccount(Account account)
        {
            try {
                var client = new ImapClient {Security = account.Security};
                client.ManualSaslAuthenticationRequired += (sender, e) => AuthenticateManually(e, account);
                var port = client.Security == SecurityPolicies.Explicit ? ImapPorts.Ssl : ImapPorts.Default;
                client.Connect(account.Host, port);
                //client.Authenticate(account.Credential);
                client.Authenticate(account.Credential,Security.Authentication.SaslMechanics.Login);
                return client;
            }
            catch (Exception ex) {
                LogSafely(ex.Message);
                throw;
            }
        }

 

Thanks in advance!

Jan 19, 2013 at 11:51 AM
Edited Jan 19, 2013 at 12:33 PM

but when i get mailmessage,there have a error:

String reference not set to an instance of a String.
Parameter name: s

 

and some email can't get view



private void DisplayMessage(MyMessage message)
        {
            AttachmentListView.Items.Clear();
            MessageViewer.Navigate("about:blank");

            foreach (var attachment in message.Message.Attachments) {
                var item = new ListViewItem(attachment.Filename) {Tag = attachment, BackColor = Color.Orange, ForeColor = Color.WhiteSmoke};
                AttachmentListView.Items.Add(item);
            }

//here count=0,but the email body is no null,there have problem
        if (message.Message.Views.Count == 0) {
                return;
            }

            if (message.Message.HasHtmlView) {
                var html = message.Message.GetHtmlView();
                DisplayView(html.Text);
            } else {
                var plain = message.Message.GetPlainTextView();

                if (plain == null) {
                    if (message.Message.Views.Count > 0) {
                        plain = message.Message.Views.First();
                    }
                }

                if (plain == null) {
                    LogSafely("No view found ... shouldnt be ...");
                    return;
                }

                // we want line breaks in text documents
                if (string.IsNullOrEmpty(plain.Text)) {
                    return;
                }

                DisplayView(plain.Text.Replace(Environment.NewLine, "<br />"));
            }
        }

 


can you give me a email to send this email to you?

Jan 25, 2013 at 11:54 PM

Unfortunately, I don't have time to administrate this project anymore.

You will need to step through the code manually and check, why the error occurs.

Feb 2, 2013 at 11:37 AM
Edited Feb 2, 2013 at 12:17 PM
i debug step by step ,no view because the email content type is "MultipartMixed",but i don't know how to fix it.
Feb 4, 2013 at 3:13 PM
Multipart/mixed is merely an indication that the content in the node is made up of nodes of different types, such as "text+attachment".
A View can never be multipart/mixed a view must be of type text/html, text/plain or some other kind of terminal node.
Can u view the mail in a regular email client, such as Thunderbird or Outlook ?