The code snippet below produces an exception using Aspose.Email version 2.1 (dotnet4).
Using Aspose.Email version 2.0 (dotnet4) it works.
Code:
Dim smtp As Aspose.Email.Mail.SmtpClient = New Aspose.Email.Mail.SmtpClient(...
Exception:
The type initializer for 'Aspose.Email.Mail.SmtpClient' threw an exception.
InnerException {"The current configuration system does not support user-scoped settings."System.Exception
Hi,
Thank you for using Aspose.Email.
We request you to please add System.Configuration to your Project’s references and see if it solves your problem? Please let us know your feedback.
I am getting the same error . Have just upgraded via Nuget.
System.configuration is already in my project.
thanks
Jon
Hi Jon,
Please accept our apology for any inconvenience caused to you.
I have tried initializing smtp with all the available constructors using following environment:
- 32 bit System, Windows 7 Ultimate, Service Pack 1, Language English (United States)
- Visual Studio 2010 Version 10.0.40219.1 SP1 Rel
- Solution Platform x86
- .NET Framework, Version = v4.0
- Aspose.Email for .NET\Bin\net4.0 Version 2.1.0.0
- No System.Configuration added to VB.Net project
Using above configuration I was successful in initializing and sending sample mail message.
Could you please give a try to this statement on some other system having similar environment.
We are also trying to re-produce the issue at our and will notify you here with our findings. It is necessary for us to re-produce the issue here for logging ticket in our bug tracking system.
Thanks for your patience and understanding.
For me v2.1 threw an exception on both my dev box (win7 pro 64bit, vs2010, dotnet4) and on a test box (win2003 32 bit).
Hi Jon,
Thank you for the feedback.
I have attached a sample SMTP project here. Please download and try it at your end, and let us know your feedback.
If the problem still persists, please provide the complete Exception message to us along with your environment details. We will look into this issue and assist you further towards a solution. We are extremely sorry for the inconvenience you are facing.
Hello all,
I am able to reproduce the problem.
The provided example is for a windows form application, which works correctly.
Any webproject however, will not work.
We've tried webpages/webservices etc.
Please find attached a web-project to demonstrate this.
PLease contact us shortly as we are currently unable to produce any emails.
Thank you.
Bas.
Hi Bas,
Thank you for providing the additional information and we are sorry for the inconvenience you are facing.
We are currently looking into this issue for our analysis and will share our findings with our development team for further investigation. We will see if we can manage some work around method for you so that you can continue your work meanwhile. Your patience in this regard is highly appreciated.
Hello Kashif,
Thank you for the reply, please know we do not have an immediate problem since we have not put Email into production yet. We will be eagerly awaiting the workaround, for us, it does not have to be pretty, it just has to work.
However, 'Acceptance Testing' has been scheduled for next week and email is the major focus point for this release. So we'll need a solution shortly or inform our customers as soon as possible.
Kind regard,
Bas.
Hi Bas,
Thanks for providing more information. We have analyzed the issue and found it in web based application using Aspose.Email for .NET 2.1.0.0. and upcoming 2.2.0.0. We have passed this info to our development team along with the request for some workaround. We will write back you here on forum as soon as some feedback is received from developers.
Thanks in advance for you patience and understanding in this regard.
This issue is logged in our bug reporting system as NETWORKNET-33475.
Thank you very much.
Just make sure that the guy in charge of unit testing buys the next round of drinks.
Hi Bas,
We have logged additional comments with this issue for the development team to look into this as soon as possible. We will update you here once we have any information from our development team and appreciate your patience in this regard.
Hi Bas,
Thank you for being patient towards the resolution of this issue.
We have fixed this issue. Please download and use the fix of Aspose.Email for .NET 2.2.0.1 as attached with this message, and let us know your feedback.
Problem solved.
We can send mails.
Quick remark:
using the parameterless constructor to have the settings read from the config file does not work.
using (var mailer = new SmtpClient())
{/// complains about missing settings }
Being more explicit about the settings, seems to help:
var config = WebConfigurationManager.OpenWebConfiguration(HttpContext.Current.Request.ApplicationPath);
using (var mailer = new SmtpClient(config))
{/// This does work. !!!
}
Both examples use the following Web.Config file.
<system.net>
<mailSettings>
<smtp from=Fake@Domain.Com>
<network host=“smtp.Domain.Com” userName="" password=""/>
</smtp>
</mailSettings>
</system.net>
Thank you for solving the problem.
Hi Bas,
Thank you for the feedback.
I have gone through the API documentation and found it to be an expected behaviour as you can see from our online documentation
HERE. When the settings are to be picked from the configuration file, you need to mention the settings explicitly. I hope that clarifies the situation.
The asp.net code below works when using aspose.email 2.0 but still fails using aspose.email 2.2.
Code:
Dim smtp As Aspose.Email.Mail.SmtpClient = New Aspose.Email.Mail.SmtpClient(AppSettings.smtpHost, AppSettings.smtpPort, AppSettings.smtpUsername, AppSettings.smtpPassword)
smtp.AuthenticationMethod = Aspose.Email.Mail.SmtpAuthentication.Login
smtp.Send(msg)
Hi,
Thank you for using Aspose.Email.
I would like to share with you that there were issues related to SmtpClient in Aspose.Email for .NET 2.2.0, which were reported to the development team and we offered you the quick fix version Aspose.Email for .NET 2.2.0.1 in our earlier post. That is the latest version till yet and we request you to please give it a try and please let us know your feedback.
2.2.0.1 fixed it for me. At least for the local installation. Didn’t deploy it yet.
Will this be released as a Nuget too?
Hi,
Thank you for the feedback.
Version 2.2.0.1 is a special fix that we managed for all those customers who were facing this issue. It will become part of the major release of Aspose.Email for .NET 2.3.0 this month. I would like to share with you that only our Major releases are put on Nugget. Once the major release of product is in place, we will update you here.
The issues you have found earlier (filed as NETWORKNET-33475) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.