wenn ich durch jmail meine mails abrufen, mache ich das wie folgt:
Set pop3 = Server.CreateObject( "JMail.POP3" )
on error resume next
pop3.Connect
Session("mailAdresse"),Session("passwort"),Session("mailServer")
if Err.number <> 0 then
Response.Write ("Die Verbindung zum Emailserver konnte nicht hergestellt
werden.<br><br>Bitte probieren Sie es sp�ter noch einmal.")
Session("loggedIn")=""
else
' This function iterates through the Attachments object,
' and saves the attachment to the server's disk.
' It also returns a nicely formatted string with a
' link to the attachment.
'***** ANZAHL DER NEUEN MAILS SPEICHERN
Session("Mailbox") = Session("Mailbox")+pop3.count
if pop3.count > 0 then
do while(loopControl <= pop3.count)
Set msg = pop3.Messages.item(loopControl)
' Note the first element of this array is 1
' since the POP3 server starts counting at 1
ReTo = ""
ReCC = ""
Set Recipients = msg.Recipients
separator = ", "
' We now need to get all the recipients,
' both normal and Carbon Copy (CC) recipients
' and store them in a variabel
For i = 0 To Recipients.Count - 1
If i = Recipients.Count - 1 Then
separator = ""
End If
Set re = Recipients.item(i)
If re.ReType = 0 Then
ReTo = ReTo & re.Name & " (" & re.EMail & ")" & separator
else
ReCC = ReTo & re.Name & " (" & re.EMail & ")" & separator
End If
Next
ReTo = ""
ReCC = ""
Set Recipients = msg.Recipients
separator = ", "
' We now need to get all the recipients,
' both normal and Carbon Copy (CC) recipients
' and store them in a variabel
For i = 0 To Recipients.Count - 1
If i = Recipients.Count - 1 Then
separator = ""
End If
Set re = Recipients.item(i)
If re.ReType = 0 Then
ReTo = ReTo & re.EMail & separator
else
ReCC = ReTo & re.EMail & separator
End If
Next
datum = msg.Date
fromName = msg.fromName
from = msg.From
CC = ReTo
BCC = ReCC
Subject = msg.Subject
Body = msg.Body
HTMLBody = msg.HTMLBody
size = msg.Size
id = now & loopControl
postfach = "posteingang"
sql = "INSERT INTO mails VALUES
('"&datum&"','"&user&"','"&fromName&"','"&from&"','"&CC&"','"&BCC&"',"&SQLSt
ring(Subject)&","&SQLString(HTMLBody)&","&SQLString(Body)&",'"&size&"','"&id
&"','"&postfach&"')"
set RS = conn.Execute(sql)
Set Attachments = msg.Attachments
separator = ", "
For i = 0 To Attachments.Count - 1
If i = Attachments.Count - 1 Then
separator = ""
End If
Set at = Attachments(i)
On Error Resume Next
at.SaveToFile( Session("Pfad") & at.Name )
attachmentName = at.Name
attachmentSize = at.Size
sql = "INSERT INTO attachments VALUES
('"&id&"','"&attachmentName&"','"&user&"','"&attachmentSize&"')"
set RS = conn.Execute(sql)
On Error Goto 0
Next
pop3.DeleteSingleMessage(loopControl)
loopControl = loopControl+1
loop
conn.close
Set conn = Nothing
pop3.Disconnect
jetzt will ich aber, dass ich die mails abrufe, sie aber in der mailbox
bleiben.
jedoch soll beim n�chsten abruf nat�rlich nur die mails abgerufen werden,
die noch nicht in die datenbank geschrieben wurden.
help!
Thomas Beckert
S i t e P o i n t
Vorstadtstra�e 57
66117 Saarbr�cken
Tel: 0681-947 26 27
Fax:0681-947 26 28
Mail: [EMAIL PROTECTED]
www.sitepoint.de
| [aspdecoffeehouse] als [email protected] subscribed
| http://www.aspgerman.com/archiv/aspdecoffeehouse/ = Listenarchiv
| Sie k�nnen sich unter folgender URL an- und abmelden:
| http://www.aspgerman.com/aspgerman/listen/anmelden/aspdecoffeehouse.asp