No MAil with Attachment using Persits ASPEMAIL.net Software

Discussion in 'ASP.NET / ASP.NET Core' started by sucharita, Dec 8, 2005.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi all,


    I wanted the users to browse a file on their local PC and upload it to our web server. I have written the following code but it gives the following stack trace error


    ------------------------


    [COMException (0x800a0043): There is no MTS object context
    ]
    ASPUPLOADLib.UploadManagerClass.SaveVirtual(String Name, Object Key, Object Ext) +0
    Beehive.testmail.Page_Load(Object sender, EventArgs e) +142
    System.Web.UI.Control.OnLoad(EventArgs e) +67
    System.Web.UI.Control.LoadRecursive() +35
    System.Web.UI.Page.ProcessRequestMain() +750
    --------------------------------------


    private void Page_Load(object sender, System.EventArgs e)
    {
    String strHost = "localhost";
    txtHost.InnerHtml = strHost;
    if( IsPostBack )
    {
    ASPUPLOADLib.IUploadManager objUpload;
    objUpload = new ASPUPLOADLib.UploadManager();

    ASPEMAILLib.IMailSender objMail;
    objMail = new ASPEMAILLib.MailSender();


    int nCount=objUpload.SaveVirtual("/aspupload",Missing.Value,Missing.Value);

    objMail.Host = strHost.ToString();
    objMail.AddAddress(txtTo.Value,Missing.Value);
    objMail.From = "[email protected]";
    objMail.Subject = txtSubject.Value;
    objMail.Body = txtBody.Value;
    objMail.AddAttachment(objUpload.Files.Item("Attachment").Path);
    try
    {
    objMail.Send( Missing.Value );
    txtMsg.InnerHtml = "<font color=green>Success! Message sent.</font>";
    }
    catch(Exception err)
    {
    txtMsg.InnerHtml = "<font color=red>Error occurred: " + err.Message + "</font>";
    }
    }


    }


    Thanks










    Post Edited (sucharita) : 12/8/2005 11:18:24 AM GMT
     
  2. more trouble shooting: http://support.persits.com/show.asp?code=PS020704100






    Joel Thoms

    DiscountASP.NET
    http://www.DiscountASP.NET
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page