C# MailFolders Object

Discussion for developers using MailEnable.
Post Reply
Shag
Posts: 7
Joined: Wed Jan 14, 2004 10:15 am

C# MailFolders Object

Post by Shag »

Hey, i am having trobbels of getting the type the following object returns.

*************************************************************
MEWebMail.MailFolders oPOPFolders = new MEWebMail.MailFoldersClass();

object RS = oPOPFolders.GetFolders(gPostOffice, gUserName, Password, "\\");

**********************************************************
The problem is that the object RS Should contain a collection of folders
but what is the type of that object?

sunpost
Posts: 438
Joined: Wed Sep 04, 2002 3:04 pm

Post by sunpost »

looks like it returns a Recordset object

Shag
Posts: 7
Joined: Wed Jan 14, 2004 10:15 am

Thnx but it works partly

Post by Shag »

OK First of all thank u, I managed to get :

ADODB.Recordset

But i cant continue from there.

Do u have any example or farther details?

Here is my code and here i am stack :

************************************************************

{
MEWebMail.MailFolders oPOPFolders = new MEWebMail.MailFoldersClass();

ADODB.Recordset RS = (ADODB.Recordset)oPOPFolders.GetFolders(gPostOffice, gUserName, gPassword, "\\");

if (!RS.EOF)
{
Response.Write("<CENTER><TABLE WIDTH=\"100%\" CELLPADDING=2 CELLSPACING=2>");

while (!RS.EOF)
{
Response.Write("<TR>\n<TD class=ME_StandardText><IMG SRC=\"");
Response.Write(GetFolderIcon(RS.Fields["FolderParentRelativePath"].ToString() + RS.Fields["FolderName"].ToString()));
Response.Write(">&nbsp;\n<A HREF=\"right.asp?ID=");
Response.Write(Server.UrlEncode(RS.Fields["FolderParentRelativePath"].ToString() + RS.Fields["FolderName"].ToString()));
Response.Write("\" TARGET=\"right\">");
Response.Write(RS.Fields["FolderName"].ToString() + "</A>\n</TD>\n</TR>\n");
RS.MoveNext();
}

Response.Write("</TABLE></CENTER>");
}
else
Response.Write("No Folders");

oPOPFolders = null;

}
***********************************************************

The RS Object Not Having Any Fields Or Data !!!

How do i get the data from it?

Best Regards

Shag

sunpost
Posts: 438
Joined: Wed Sep 04, 2002 3:04 pm

Post by sunpost »

i get the same thing too :cry:

Shag
Posts: 7
Joined: Wed Jan 14, 2004 10:15 am

YES, Success!!!!

Post by Shag »

Thank U Very Much,
I Managed to get the details, here are the result

{
MEWebMail.MailFolders oPOPFolders = new MEWebMail.MailFoldersClass();

ADODB.Recordset RS = (ADODB.Recordset)oPOPFolders.GetFolders(gPostOffice, gUserName, gPassword, "\\");

if (!RS.EOF)
{
Response.Write("<CENTER><TABLE WIDTH=\"100%\" CELLPADDING=2 CELLSPACING=2>");

while (!RS.EOF)
{
Response.Write("<TR>\n<TD class=ME_StandardText><IMG SRC=\"");
Response.Write(GetFolderIcon(RS.Fields["FolderParentRelativePath"].Value.ToString() + RS.Fields["FolderName"].Value.ToString()));
Response.Write(">&nbsp;\n<A HREF=\"right.asp?ID=");
Response.Write(Server.UrlEncode(RS.Fields["FolderParentRelativePath"].Value.ToString() + RS.Fields["FolderName"].Value.ToString()));
Response.Write("\" TARGET=\"right\">");
Response.Write(RS.Fields["FolderName"].Value.ToString() + "</A>\n</TD>\n</TR>\n");
RS.MoveNext();
}

**********************************************************

It Works,
Best Regards,
Shag

sunpost
Posts: 438
Joined: Wed Sep 04, 2002 3:04 pm

Post by sunpost »

what Type did you use for gPostOffice, gUserName, gPassword :?:

Shag
Posts: 7
Joined: Wed Jan 14, 2004 10:15 am

Type of gPostOffice, gUserName, gPassword

Post by Shag »

i used strings types as follow

string gX = Session["X"].ToString();

Post Reply