zerogravity187
asked on
How to check email with vbscript using chilisoftASP POP3 component....
need to read message and show who from...
anybody out there? Chilisoft has very poor pdf docs on this subject...
Thanks
anybody out there? Chilisoft has very poor pdf docs on this subject...
Thanks
You could do this with Exchange 2000 and IIS5 but not with ChiliSoft...
ASKER
Well, then what is the SpicePak POP3 component for?
here is a simple jscript example:
<% @ LANGUAGE=JScript %>
<html>
<body>
<h1>hello <%=Request.Form('user')%>, here is your mail</h1>
<table border>
<%
pop3 = Server.CreateObject("CHILI .POP3.1");
pop3.Connect("mail.jumpbac ks.com",
Request.Form('user'),
Request.Form('password'));
for (var i=0; i<pop3.Messages.Count; i++) {
var mess = pop3.Messages(i);
%>
<tr><th>From</th><th><%=me ss.From%>< /th></tr>
<tr><th>To</th><th><%=mess .To%></th> </tr>
<tr><th>CC</th><th><%=mess .CC%></th> </tr>
<tr><td>Subject</td><td><% =mess.Subj ect%></td> </tr>
<tr><td>DateSent</td><td>< %=mess.Dat eSent%></t d></tr>
<tr><td>10 lines of message</td><td><pre><%=me ss.Preview Message(10 )%></pre>< /td></tr>
<tr><td>Attachments</td><t d><table border>
<%
for (var j = 0; j<mess.Attachments.Count; j++) {
%>
<tr><td><%=j%></td><td><%= mess.Attac hments[j]. Read()%></ td></tr>
<%
}
%>
</table></td></tr>
<%
}
pop3.Disconnect();
%>
</table>
</body>
</html>
here is a simple jscript example:
<% @ LANGUAGE=JScript %>
<html>
<body>
<h1>hello <%=Request.Form('user')%>,
<table border>
<%
pop3 = Server.CreateObject("CHILI
pop3.Connect("mail.jumpbac
Request.Form('user'),
Request.Form('password'));
for (var i=0; i<pop3.Messages.Count; i++) {
var mess = pop3.Messages(i);
%>
<tr><th>From</th><th><%=me
<tr><th>To</th><th><%=mess
<tr><th>CC</th><th><%=mess
<tr><td>Subject</td><td><%
<tr><td>DateSent</td><td><
<tr><td>10 lines of message</td><td><pre><%=me
<tr><td>Attachments</td><t
<%
for (var j = 0; j<mess.Attachments.Count; j++) {
%>
<tr><td><%=j%></td><td><%=
<%
}
%>
</table></td></tr>
<%
}
pop3.Disconnect();
%>
</table>
</body>
</html>
ASKER
will repost....
ASKER
will repost....
Are you asking or telling???
The Chili!Pop3 1.0 Control enables users retrieve messages from a POP3 server using ASP scripts. This component has two main interfaces. The first, the POP3 interface, deals with the message collection by retrieving messages and controlling messages from a POP3 server. The second interface, the Message interface, exposes all of the properties of a single message. Additional interfaces are exposed to support retrieval of message lists and message attachments.
The Chili!Pop3 1.0 Control enables users retrieve messages from a POP3 server using ASP scripts. This component has two main interfaces. The first, the POP3 interface, deals with the message collection by retrieving messages and controlling messages from a POP3 server. The second interface, the Message interface, exposes all of the properties of a single message. Additional interfaces are exposed to support retrieval of message lists and message attachments.
ASKER
I am asking, I can do it in jscript, but having trouble in vbscript... All I need to do is be able to recurse through the unread mail, read in the text of the body for parsing into a csv for database, remove the msgs off the server, and be able to parse the subject--attachments are not necessary.
What? Are you having difficulty converting that example to VBScript?
Does it work using JScript?
Does it work using JScript?
ASKER
well, It does work, but I just dont have time to re-engineer it to vbscript... somebody should write a script that can do that :)
Thanks for the input - If somebody can get it, I will increase the points....
Thanks for the input - If somebody can get it, I will increase the points....
ASKER
I am asking, I can do it in jscript, but having trouble in vbscript... All I need to do is be able to recurse through the unread mail, read in the text of the body for parsing into a csv for database, remove the msgs off the server, and be able to parse the subject--attachments are not necessary.
Well, if you want it in VBscript:
<% @ LANGUAGE="VBScript" %>
<html>
<body>
<h1>hello <%=Request.Form("user")%>, here is your mail</h1>
<table border>
<%
Set pop3 = Server.CreateObject("CHILI .POP3.1");
pop3.Connect("mail.jumpbac ks.com", _
Request.Form("user"), _
Request.Form("password"))
For i = 0 To pop3.Messages.Count - 1
mess = pop3.Messages(i)
%>
<tr><th>From</th><th><%=me ss.From%>< /th></tr>
<tr><th>To</th><th><%=mess .To%></th> </tr>
<tr><th>CC</th><th><%=mess .CC%></th> </tr>
<tr><td>Subject</td><td><% =mess.Subj ect%></td> </tr>
<tr><td>DateSent</td><td>< %=mess.Dat eSent%></t d></tr>
<tr><td>10 lines of message</td><td><pre><%=me ss.Preview Message(10 )%></pre>< /td></tr>
<tr><td>Attachments</td><t d><table border>
<%
for j = 0 To mess.Attachments.Count - 1
%>
<tr><td><%=j%></td><td><%= mess.Attac hments[j]. Read()%></ td></tr>
<%
Next
%>
</table></td></tr>
<%
Next
pop3.Disconnect()
%>
</table>
</body>
</html>
And that should do you!!!
<% @ LANGUAGE="VBScript" %>
<html>
<body>
<h1>hello <%=Request.Form("user")%>,
<table border>
<%
Set pop3 = Server.CreateObject("CHILI
pop3.Connect("mail.jumpbac
Request.Form("user"), _
Request.Form("password"))
For i = 0 To pop3.Messages.Count - 1
mess = pop3.Messages(i)
%>
<tr><th>From</th><th><%=me
<tr><th>To</th><th><%=mess
<tr><th>CC</th><th><%=mess
<tr><td>Subject</td><td><%
<tr><td>DateSent</td><td><
<tr><td>10 lines of message</td><td><pre><%=me
<tr><td>Attachments</td><t
<%
for j = 0 To mess.Attachments.Count - 1
%>
<tr><td><%=j%></td><td><%=
<%
Next
%>
</table></td></tr>
<%
Next
pop3.Disconnect()
%>
</table>
</body>
</html>
And that should do you!!!
ASKER
alfanomore, nice work...there were some small bugs...did you test out the script first? Here is the fully working script with no errors (to my knowlege):
<% @ LANGUAGE="VBScript" %>
<html>
<body>
<h1>hello <%=Request.Form("user")%>, here is your mail</h1>
<table border>
<%
Set pop3 = Server.CreateObject("CHILI .POP3.1")
pop3.connect "mail.jumpbacks.com",reque st.form("u ser"),Requ est.Form(" password")
For i = 0 To pop3.Messages.Count - 1
mess = pop3.Messages(i)
%>
<tr><th>From</th><th><%=me ss.From%>< /th></tr>
<tr><th>To</th><th><%=mess .To%></th> </tr>
<tr><th>CC</th><th><%=mess .CC%></th> </tr>
<tr><td>Subject</td><td><% =mess.Subj ect%></td> </tr>
<tr><td>DateSent</td><td>< %=mess.Dat eSent%></t d></tr>
<tr><td>10 lines of message</td><td><pre><%=me ss.Preview Message(10 )%></pre>< /td></tr>
<tr><td>Attachments</td><t d><table border>
<%
for j = 0 To (mess.Attachments.Count - 1)
%>
<tr><td><%=j%></td><td><%= (mess.Atta chments(j) .Read())%> </td></tr>
<%
Next
%>
</table></td></tr>
<%
Next
pop3.Disconnect()
%>
</table>
</body>
</html>
<% @ LANGUAGE="VBScript" %>
<html>
<body>
<h1>hello <%=Request.Form("user")%>,
<table border>
<%
Set pop3 = Server.CreateObject("CHILI
pop3.connect "mail.jumpbacks.com",reque
For i = 0 To pop3.Messages.Count - 1
mess = pop3.Messages(i)
%>
<tr><th>From</th><th><%=me
<tr><th>To</th><th><%=mess
<tr><th>CC</th><th><%=mess
<tr><td>Subject</td><td><%
<tr><td>DateSent</td><td><
<tr><td>10 lines of message</td><td><pre><%=me
<tr><td>Attachments</td><t
<%
for j = 0 To (mess.Attachments.Count - 1)
%>
<tr><td><%=j%></td><td><%=
<%
Next
%>
</table></td></tr>
<%
Next
pop3.Disconnect()
%>
</table>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.