asp.net - VB.Net Outlook email creation works locally, fails on server -


When I run my project on my local machine, it generates Outlook email as expected, but if I do all my This error message fails when our development server runs the code: [exception: can not create ActiveX component.] Microsoft.VisualBasic.Interaction.CreateObject (String ProgId, String ServerName) +509721 etc ...

I know this is Outlook which failed because if I comment on the sendmail () function, then The rest of the page works fine (this does not just make email). Outlook is installed with local machine windows 7, server is 2008R2, no office is installed, I have other pages which can write in excel files, but they are using crystallersport to handle it, so I'm sure Not that the server requires Outlook DLL, or need to be something else.

Aspx page with a VB.Net code. My Email Looks Like:

  OMail2 = OApp2 as a slow OApp2 object, as an OMail2 object, signature 2 string OApp2 = CreateObject ("Outlook.Application"). Create a new ArrayList (2) dim iCounter such as alAttachList.Instert (0, "E: \ test \ debug code code.txt") alAttachList.Instert (1, "\\ RemoteServer \ z \ test \") as the CreateItem (0) Dim alAttachList Hello.bmp ") sBody + =" & lt; br / & gt; "+" There are some files attached. " + "& lt; br / & gt; + "They can also find them: X: \ Test \ Test \ Name" with OMail 2. Display () end with signature 2 = OMail2. Ommail2 with HTMLBD.aspx = sSubject .set = STO. Cc = scc.lmtb = sbd; 








< & Amp; Interact with the signature 2 end as the dim sBodyLen = int (sBody.Length) as the octave22 Interop.Outlook.Attachments = OMail2. Attachments dim oAttach2 Interop.Outlook2 as iCounter = 0 for alAttachList.Count- 1 oAttach2 = oAttachs2.Add (source: = altcallist (iCounter), displayname: = allelelist (iCounter)) Next Omegle 2. Display (True) OApp2 = nothing OMail2 = nothing

When you do this Some do something:

  OApp2 = CreateObject ("Outlook.Application")   

You are using Office.Interop libraries which are MS Office (or If you go to that route then individual applications are installed)

You must install MS Office or at least Outlook on the server to use Office. . You can consider using MAPI instead of Interpop to send your emails, MAPI is part of .NET and there is no need to install additional programs on your server.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -