Fetch outllook data to add to mysql

  • Thread starter Thread starter user12345jmnm
  • Start date Start date
U

user12345jmnm

Guest
Hey,

I am stuck with retrieving email data from this code

My mysql table looks like this:

TicketID varchar(15) True
Caller char(30) True
Priority varchar(15) True
Business_service char(15) True
Short_description varchar(30) True
False




My email looks like this:

SLA warning for INC33333333<o:p></o:p>

Ticket Details:
Short description: ship-to 8766545 cannot be found in 27.20.2.2 customer ship-to modify
Caller: Octavian
Priority: 3 - Moderate
Business service: TCSIT<o:p></o:p>


My code looks like this:

MySqlCommand com = new MySqlCommand("insert into " + tableName + " (" + colName + ") values (" + paramName + ")", connection);
MySqlDataReader read = null;

string emailBody = mail.EmailBody; // Extract Short description, Caller, Priority, Business service from the

string Short_description = ""; // Need to get the shortDescription from emailBody
string Caller = "";
string Priority = "";
string Business_service = "";
string TicketID = "";

// Number of parameters should match with DB table except auto increment ID in DB.
com.Parameters.Clear();
com.Parameters.Add("@TicketID", MySqlDbType.VarChar).Value = TicketID;
com.Parameters.Add("@Caller", MySqlDbType.VarChar).Value = Caller;
com.Parameters.Add("@Priority", MySqlDbType.VarChar).Value = Priority;
com.Parameters.Add("@Business_service", MySqlDbType.VarChar).Value = Business_service;
com.Parameters.Add("@Short_description", MySqlDbType.VarChar).Value = Short_description;

read = com.ExecuteReader();
read.Close();



emailbody has all the mails

My problem: When i run this i am getting an empty table without any values, can you please tell me how to fetch these values(short description, priority, caller etc from the mail) and add to the table.

I tried using Contains and startswith but still ain't getting it.


Thank you.

Continue reading...
 
Back
Top