- Where can I download MailBee.NET Objects updates and update my current installation?
- My installation of MailBee.NET Objects seems to be broken. How can I repair it?
- I'm going to distribute my application powered by MailBee.NET Objects. Which files should I include in my package?
- How to add MailBee.NET Objects in my .NET-based project?
- Timeout error occurs during submitting a mail message to an SMTP server. What's wrong?
- How to download unread e-mails in POP3?
- I'm receiving "Could not load type System.Byte from assembly MailBee.NET" error. How to resolve?
- Troubleshooting.
1. Where can I download MailBee.NET Objects updates and update my current installation?
The latest production version of MailBee.NET Objects is available at:
http://www.afterlogic.com/download/MailBeeNetObjects.msi
The latest beta version of MailBee.NET.dll is available at:
http://www.afterlogic.com/updates/mailbee_net_1.zip (.NET 1.1 and above)
http://www.afterlogic.com/updates/mailbee_net_2.zip (.NET 2.0 and above)
When you've downloaded MailBee.NET package installer
MailBeeNetObjects.msi, the first thing to do is to close all applications which may use MailBee.NET. If Visual Studio .NET is running, please close it too. After that, you need to remove your existing MailBee.NET Objects installation. To remove existing version of the product, use
Add / Remove Programs in
Control Panel. Then, new version of MailBee.NET can easily be installed: just run the installer and follow the on-screen instructions.
Now, you have the new version of MailBee.NET Objects installed, but your applications powered by MailBee.NET Objects still reference to the old version. Thus, you should update references in the projects and rebuild the applications powered by MailBee.NET Objects.
For Visual Studio .NET projects, you should remove reference to
MailBee.NET (open references of the project in
Solution Explorer and remove reference to
MailBee.NET), then add new one. Rebuild the project.
For non-Visual Studio .NET environment, you should manually replace
MailBee.NET.dll file in the
/bin subfolder of your application and rebuild the project. After installation of MailBee.NET package you can find
MailBee.NET.dll file in installation folder (by default it is
"C:\Program Files\MailBee.NET Objects").
2. My installation of MailBee.NET Objects seems to be broken. How can I repair it?
3. I'm going to distribute my application powered by MailBee.NET Objects. Which files should I include in my package?
MailBee.NET.dll assembly is the only file required to distribute MailBee.NET Objects across computer systems. Copy it to any location and add as a reference to your projects.
4. How to add MailBee.NET Objects in my .NET-based project?
In Visual Studio .NET, follow the steps below (it's assumed your Visual Studio .NET project is named
EmailApp):
- In Solution Explorer, right-click the project name (EmailApp), and select Add and then Add Existing Item command in the context menu.
- In the appeared Add Existing Item dialog, select All Files under Files of type dropdown. Locate MailBee.NET.dll file (by default, it's installed into "C:\Program Files\MailBee.NET Objects" folder), and double-click it. Now MailBee.NET.dll gets uploaded into the root folder of EmailApp project.
- In Solution Explorer, right-click the project name (EmailApp), and select Add Reference command in the context menu.
- In the appeared Add Reference dialog, click Browse button, select MailBee.NET.dll file, and double-click it. Now MailBee.NET Objects library gets referenced from your application.
In the steps above, we uploaded a copy of
MailBee.NET.dll into the project folder and referenced this copy. The original
MailBee.NET.dll is no longer needed. The application can be easily XCOPY deployed using this method.
To reference MailBee.NET Objects library in non-Visual Studio .NET application, you should manually upload
MailBee.NET.dll file into the
/bin folder under the root folder of your application. If there is no /bin folder, you should create it first.
The application referencing MailBee.NET Objects library in such a way can take advantage of XCOPY deployment.
Once MailBee.NET Objects library is referenced from your application, the next step is to import namespaces declared in the library into your application as shown in samples in MailBee.NET Objects documentation or in the demo projects shipped with MailBee.NET Objects.
Now, you may start developing your application powered by MailBee.NET Objects.
5. Timeout error occurs during submitting a mail message to an SMTP server. What's wrong?
Probably, you're using a firewall, anti-spam or anti-virus filter which intercepts network traffic between MailBee.NET and your SMTP server,
and this network filter does not actually support CHUNKING extension despite it says CHUNKING is supported. To fix this, disable this
network filter or obtain its newer version without this bug. Alternatively, you can disable CHUNKING in MailBee.NET (but this will
degrade performance a bit). To disable CHUNKING, use this code:
server.SmtpOptions = ExtendedSmtpOptions.NoChunking
(assuming
server is an
SmtpServer instance).
6. How to download unread e-mails in POP3?
To download only new messages in a POP3 account:
- You'll need a database where you'll store the list of UIDs of message which have already been downloaded during previous sessions. Let's assume you already have one.
- Download list of UIDs of all message in Inbox using pop.GetMessageUids method:
http://www.afterlogic.com/mailbee_net/docs/MailBee.Pop3Mail.Pop3.GetMessageUids.html
- Compare the list of UIDs you've downloaded with the list in your database. All UIDs which are present in the new list but are missing in the list you got from the database correspond to unread messages. For each of new UIDs, convert its UID to message index using GetMessageIndexFromUid method:
http://www.afterlogic.com/mailbee_net/docs/MailBee.Pop3Mail.Pop3.GetMessageIndexFromUid.html
- Now when you have MessageIndex converted from UID, you can download message using DownloadEntireMessage method:
http://www.afterlogic.com/mailbee_net/docs/MailBee.Pop3Mail.Pop3.DownloadEntireMessage.html
This should be repeated for every new message.
- After downloading all new messages, replace the list of UIDs in the database with the list you've downloaded (i.e. delete all records with older UIDs for this email account and save into database all UIDs you received from the mail server during the current session). It's important that you should save into the database the list of all UIDs (as returned by pop.GetMessageUids method), not only UIDs of new messages.
When you run this for the very first time (and your UID list in database is empty), all UIDs will be considered new and you'll get all the messages.
This approach is used by virtually any POP3 client.
7. I'm receiving "Could not load type System.Byte from assembly MailBee.NET" error. How to resolve?
Use MailBee.NET.dll version optimized for .NET 2.0 and above. You can
get the latest version from
http://www.afterlogic.com/updates/mailbee_net_2.zip.
If the above does not help, this often means .NET Framework 2.0 installation is damaged. For instance, this occurs when SQL Server 2005 SP1 update gets installed.
The solution is to uninstall SQL Server 2005 SP1 or select Repair option in .NET Framework 2.0 installer. Click
here for details.
8. Troubleshooting.
To make MailBee.NET log all activity into a log file, use
mailer.Log property (assuming
mailer is an instance of
Smtp,
Pop3, or
Imap class).
Log file may help you to quickly find out the cause of the problem.
To disable all advanced features and achieve maximum compatibility level with all mail servers, set
Global.SafeMode = true before using MailBee.NET in the code. This measure can be used together with other debugging options listed in this topic.
Authentication (wrong login or password) problems often indicate login name is incorrect (for instance,
'user@domain' or 'domain\user' is expected while 'user' was supplied, or vice versa).
If you experience an error on attempt to send an e-mail to a non-local e-mail address, you should make sure you enabled SMTP authentication
in MailBee.NET. If you're adding your SMTP server definition to
Smtp.SmtpServers collection using the code like
mailer.SmtpServers.Add(serverName), you should change it to
mailer.SmtpServers.Add(serverName, userName, password) where
mailer is an
Smtp instance,
userName and
password correspond to a mail account you're sending your e-mail from.