2
Answers

Configuration system failed to initialize smtpop.dll

Photo of Rudy Beset

Rudy Beset

14y
4.5k
1
Hi,

I am now trying for a few days to resolve an error.

I created a project to read from a pop3 emailbox and get the attachments from all messages, save them to a local folder.
I used the smtpop.dll freeware library.
I worked with the code on this site: http://www.fryan0911.com/2009/05/how-to-read-pop3-email-using-c.html

This is working fine in debug mode. All attachments get pulled from the emails and saved to folder.
But... when i build the project and try to run the project, from the /release folder or any other pc, then i get the error:Configuration system failed to initialize
I placed the smtpop.dll in the same folder as the .exe
i referenced and used the .dll as described on the website.

What am i doing wrong, why do i get the error after building and not while debugging ?

Can anyone shed some light on it ?

rudy


Answers (2)

1
Photo of Amit Gupta
NA 16.5k 25.7k 8y
Hey Ahmed,
Please review your code and question, as you are asking 'excel file was not created' and in your code, you are returning false, if file doesnot exists
 
if (!File.Exists(strFilePath)) return false;
 
Please check the below link for your reference: 
 http://csharp.net-informations.com/excel/csharp-create-excel.htm
0
Photo of Alex Smith
NA 356 6.8k 8y
Hi, check this link for generating Excel from database.
 
https://www.e-iceblue.com/Tutorials/Spire.XLS/Spire.XLS-Program-Guide/Data-Export-/Import-Export-Datatable-to-Excel-from-Database.html
-1
Photo of ahmed salah
NA 510 30.3k 8y
my problem only in creating excel so that i try with another way 
in the code here excel file  created but not open so that can you tell me why not open after created
my code as bellow
  1. public void CreateSheetIfNotExists()  
  2.        {  
  3.            using (System.Data.OleDb.OleDbConnection databaseConnection = new System.Data.OleDb.OleDbConnection())  
  4.            {  
  5.   
  6.                DataTable schemaTable = default(DataTable);  
  7.   
  8.                databaseConnection.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=D:\\Book310.xlsx;Extended Properties=Excel 12.0;";  
  9.   
  10.                databaseConnection.Open();  
  11.   
  12.                schemaTable = databaseConnection.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, new object[] {  
  13.            null,  
  14.            null,  
  15.            "Sheet1$"  
  16.        });  
  17.   
  18.                if (schemaTable.Rows.Count == 0)  
  19.                {  
  20.                    string SQLDDLCommand = "CREATE TABLE [Sheet1] (UserID INTEGER, UserName CHAR(255))";  
  21.                    System.Data.OleDb.OleDbCommand excelCommand = new System.Data.OleDb.OleDbCommand(SQLDDLCommand, databaseConnection);  
  22.                    excelCommand.ExecuteNonQuery();  
  23.                      
  24.                }  
  25.               
  26.                databaseConnection.Close();  
  27.            }  
  28.        }  
after that file 310 created but not open
when open file i get this error