Free Support Forum - aspose.com

Cloning MailMessage

I’m using Aspose.Network version 3.9.1.0 demo to clone a mail message with an HtmlBody

I’m getting the following exception when performing the clone:

System.MissingMethodException: No parameterless constructor defined for this object.
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at Aspose.Network.Mail.AttachmentBase.x8b61531c8ea35b85()
at Aspose.Network.Mail.AlternateViewCollection.x8b61531c8ea35b85()
at Aspose.Network.Mail.MailMessage.Clone()
at AsposeMailMerge.AsposeMailMerge.Snippet() in C:\Documents and Settings\leovg.BSOLVE\My Documents\Downloads\Utilities\Work\WordMailMerge\AsposeMailMerge\AsposeMailMerge.cs:line 155

Here is the code I’m using:

MailMessage temp2 = new MailMessage(“leovg@bsolve.co.za”, “leovg@bsolve.co.za”);
temp2.TextBody = “Hello again”;

try
{
MailMessage clone = temp2.Clone();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}

Any idea on what I’m doing wrong?

I also tried to use the code snippet found in MailMerge.cs, which produced the same error message.

Leo

I went and downloaded a previous version of Aspose.Network (3.8.2.0) and it works.

Leo

Hello, Leo,

It is a bug in the v3.9. We are now working on the bug fixing and regression. The hofix will be release ASAP, maybe tomorrow.

I will keep you posted.

Thanks

Hello,

Please check the hotfix dll attached. Let me know if it works.

Thanks