hye....

I can send a mail by using CDONTS.and when I send mail
by using CDONTS than all mail go to Inetpub\mailroot\Drop.
now my main problem is that i want to display all message from the
drop.for it i have code of VB which is properly working.but i cant
convert it in c#.and i have to do it in C#.
my vb code is:-

<%@ Page language="c#" Codebehind="ruf.aspx.cs" AutoEventWireup="false"
Inherits="matchfinder.ruf" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>ruf</title>
<meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="ruf" method="post" runat="server">
</form>
<form id="Form1" method="post" runat="server">
</form>
<%
CDONTS.Session objInbox =new CDONTS.Session();

Messages colMsgs;



CDONTS.Session objCurSession = new CDONTS.Session();
objCurSession.LogonSMTP("userid","hhh@datingsite.com");
Session.Add("CurSession",objCurSession);


objInbox= objCurSession.Inbox;

colMsgs= objInbox.GetMessage ;

if (colMsgs.Count > 0 )
{
%>
<table cellSpacing="1" cellPadding="1" width="90%" border="1">
<tr>
<td>Importance</td>
<td>From</td>
<td>Subject</td>
<td>Sent</td>
</tr>
<%
int intLoop=0;
for (intloop = 1 ;intloop < colMsgs.Count;intloop++)
{

%>
<tr>
<td align="middle"></td>
<td><% =colMsgs(intLoop).Recipients %></td>
<td><A href="ViewMessage.ASPx?MsgID=<% =intLoop %>" >
<% =colMsgs(intloop).Subject %>
</A>
</td>
<td><% =colMsgs(intloop).TimeSent %>
</td>
</tr>
<%
}
}

%>
</table>
</body>
</HTML>

ps help me as soon as possible..........


*** Sent via Developersdex http://www.developersdex.com ***

Re: view messages using CDONTS in c# .NET by Kristofer

Kristofer
Mon May 09 09:55:59 CDT 2005

Hello,

Since this is related to C# and VB, and not IIS, i would recommend you to
post to newsgroups for C# or VB instead. You will probably get the best
help from the C# newsgroup:

microsoft.public.dotnet.languages.csharp

Please also take into consideration that CDONTS is not supported on
Windows Server 2003. So if you plan to run this code on Windows Server
2003 (or later) in the future, you maybe want to rewrite the code
completely without using CDONTS.



--
Regards,
Kristofer Gafvert
www.gafvert.info - My Articles and help
www.ilopia.com


mahiti joshi wrote:

>
> hye....
>
> I can send a mail by using CDONTS.and when I send mail
> by using CDONTS than all mail go to Inetpub\mailroot\Drop.
> now my main problem is that i want to display all message from the
> drop.for it i have code of VB which is properly working.but i cant
> convert it in c#.and i have to do it in C#.
> my vb code is:-
>
> <%@ Page language="c#" Codebehind="ruf.aspx.cs" AutoEventWireup="false"
> Inherits="matchfinder.ruf" %>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
> <HTML>
> <HEAD>
> <title>ruf</title>
> <meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
> <meta content="C#" name="CODE_LANGUAGE">
> <meta content="JavaScript" name="vs_defaultClientScript">
> <meta content="http://schemas.microsoft.com/intellisense/ie5"
> name="vs_targetSchema">
> </HEAD>
> <body MS_POSITIONING="GridLayout">
> <form id="ruf" method="post" runat="server">
> </form>
> <form id="Form1" method="post" runat="server">
> </form>
> <%
> CDONTS.Session objInbox =new CDONTS.Session();
>
> Messages colMsgs;
>
>
>
> CDONTS.Session objCurSession = new CDONTS.Session();
> objCurSession.LogonSMTP("userid","hhh@datingsite.com");
> Session.Add("CurSession",objCurSession);
>
>
> objInbox= objCurSession.Inbox;
>
> colMsgs= objInbox.GetMessage ;
>
> if (colMsgs.Count > 0 )
> {
> %>
> <table cellSpacing="1" cellPadding="1" width="90%" border="1">
> <tr>
> <td>Importance</td>
> <td>From</td>
> <td>Subject</td>
> <td>Sent</td>
> </tr>
> <%
> int intLoop=0;
> for (intloop = 1 ;intloop < colMsgs.Count;intloop++)
> {
>
> %>
> <tr>
> <td align="middle"></td>
> <td><% =colMsgs(intLoop).Recipients %></td>
> <td><A href="ViewMessage.ASPx?MsgID=<% =intLoop %>" >
> <% =colMsgs(intloop).Subject %>
> </A>
> </td>
> <td><% =colMsgs(intloop).TimeSent %>
> </td>
> </tr>
> <%
> }
> }
>
> %>
> </table>
> </body>
> </HTML>
>
> ps help me as soon as possible..........
>
>
> *** Sent via Developersdex http://www.developersdex.com ***