1

Konu: mail için activex

merhaba,

microsoft outlook , outlook express kullanmadan
direk içinden smtp, pop3 ayarları yapılabilen ve mail gönderilebilen
fox ile problemsiz çalışacak activex yada dll hangisidir.

bu konuda tecrübesi olan arkadaşlar var mı?

şimdiden teşekkürler

2

Re: mail için activex

CDOSSYS.DLL kullanılarak yapilan bir gonderim sekli , w2k ve Xp de sistemle birlikte yukleniyor yani windows built in , birden fazla kisiye mail gondermek attachment ayarlamak biraz da programciya kaliyor ama standart olarak gonderim sekli bu ve outlook veya outlook expres vs ye ihtiyaci yok.
ben bu uygulamayi cari hesap kartlarindan secim yaptirarak gonderiyorum boylelikle windows adres defteri veya outlook vs adres defteri bilgileri gerekmiyor...

Visual Fox Pro
1

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
lcFrom = "[email protected]"

lcTo = "[email protected];[email protected]"
lcSubject = "Hey Have You Tried VFP Email?"
llHTMLFormat = .T. && change to .F. to send plain text message *!* Sending the body in HTML format
lcBody =  "body message"
lcCC = ""
lcBCC = ""
lcMailServer = "mail.soykansoft.com" && my SMTP Server
lcUserName = "[email protected]" && my SMTP username
lcPassword = "xxxxxx" && my SMTP password
lcAttach = m.lcTifFile
 
SendViaCDOSYS(@lcErrReturn, lcFrom, lcTo, lcSubject, lcBody, lcAttach, lcCC, lcBCC, lcMailServer, lcUserName, lcPassword, llHTMLFormat)
 
If Empty(lcErrReturn)
    Messagebox("'" + lcSubject + "' Başarıyla Gönderildi", 64, "CDOSYS Mail Sending System")
Else
    Messagebox("'" + lcSubject + "' Gönderilemedi.  Sebebi:" + Chr(13) + lcErrReturn, 64, "CDOSYS Mail Sending System")
Endif
 
Procedure SendViaCDOSYS(tcReturn, tcFrom, tcTo, tcSubject, tcBody, taFiles, tcCC, tcBCC, tcMailServer, tcUserName, tcPassword, tlHTMLFormat)
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&6
Local lcSchema, loConfig, loMsg, loAtt, lnCountAttachments
Try
    lcSchema = "http://schemas.microsoft.com/cdo/configuration/"
 
    loConfig = Createobject("CDO.Configuration")
 
    With loConfig.Fields
        .Item(lcSchema + "smtpserverport") = 25 && SMTP Port
        .Item(lcSchema + "sendusing") = 2 && Send it using port
        .Item(lcSchema + "smtpserver") = tcMailServer && host of smtp server
        .Item(lcSchema + "smtpauthenticate") = 1 && Authenticate
        .Item(lcSchema + "sendusername") = tcUserName && Username
        .Item(lcSchema + "sendpassword") = tcPassword && Password
        .Update
    Endwith
 
    loMsg = Createobject ("CDO.Message")
    loMsg.Configuration = loConfig
    With loMsg
        .From = tcFrom
        .To = tcTo
        If Type("tcCC") = "C"
            .CC = tcCC
        Endif
        If Type("tcBCC") = "C"
            .BCC = tcBCC
        Endif
        .Subject = tcSubject
        If tlHTMLFormat
            .HTMLBody = tcBody
        Else
            .TextBody = tcBody
        Endif
&&IF TYPE("tafiles",1) = "A"
&& FOR lnCountAttachments = 1 TO ALEN(taFiles)
&&  loAtt=.AddAttachment(taFiles(lnCountAttachments))
&& ENDFOR
&& ENDIF
        .AddAttachment(taFiles)
        .Send()
    Endwith
 
Catch To loError
    tcReturn = [Hata: ] + Str(loError.ErrorNo) + Chr(13) + ;
        [SatirNumarasi: ] + Str(loError.Lineno) + Chr(13) + ;
        [HataMesaji: ] + loError.Message + Chr(13) + ;
        [Procedure: ] + loError.Procedure + Chr(13) + ;
        [Detaylari: ] + loError.Details + Chr(13) + ;
        [Yigin: ] + Str(loError.StackLevel) + Chr(13) + ;
        [SatirIcerigi: ] + loError.LineContents
Finally
    Release loConfig, loMsg
    Store .Null. To loConfig, loMsg
Endtry
Endproc
http://www.soykansoft.com/images/twitter.jpghttp://www.soykansoft.com/images/wp.jpghttp://www.soykansoft.com/images/blogger.jpg

3

Re: mail için activex

variable 'lcErrReturn' is not found mesajını veriyor.
lcErrReturn un default değeri ne olmalı?

http://www.tek-tips.com/viewthread.cfm?qid=797973

Son düzenleyen, mrduyar (28.12.2006 08:43:32)

Bilmediğin Neyse Yanıldığındır.

4

Re: mail için activex

mrduyar yazdı:

variable 'lcErrReturn' is not found mesajını veriyor.
lcErrReturn un default değeri ne olmalı?

http://www.tek-tips.com/viewthread.cfm?qid=797973


lcErrReturn ye lcTifFile değişkenlerine değer ataman gerekiyor.


Visual Fox Pro
1

2
3
4
5
6
lcMailServer = "mail.soykansoft.com" && my SMTP Server

lcUserName = "[email protected]" && my SMTP username
lcPassword = "xxxxxx" && my SMTP password
lcTifFile = ""
lcAttach = m.lcTifFile
lcErrReturn = ""

5

Re: mail için activex

evet lctiffFile konusunda aciklama yapmamisim sad

local lctiffFile = sys(5)+CURDIR()+[CHEXTRE.TIF]
lcAttach = m.lcTiffFile

gibi bir referans vermel gerekiyor attacment icin

http://www.soykansoft.com/images/twitter.jpghttp://www.soykansoft.com/images/wp.jpghttp://www.soykansoft.com/images/blogger.jpg

6

Re: mail için activex

Bunlar çok iyi ama postayı serverdan almanın bir yolu varmı ?

7

Re: mail için activex

cetinyasar yazdı:

Bunlar çok iyi ama postayı serverdan almanın bir yolu varmı ?


eger MS outlook kullaniyorsan asagidaki kod VFP formu uzerinde MS Outlook uzerinde yaptiklarinin bir cogunu yapiyor

Visual Fox Pro
1

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
PUBLIC oform1

oform1=NEWOBJECT("form1")
  WITH oform1
    .setall("fontsize",8,"commandbutton")
   ENDWITH  
oform1.Show
oform1.showtips=.t.
RETURN
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
DEFINE CLASS form1 AS form
 
    Height = 400
    Width = 790
    DoCreate = .T.
    Caption = "MS Outlook Integration"
    Name = "Form1"
    autocenter=.t.
 
    ADD OBJECT cmdExit AS commandbutton WITH ;
        Top = 360, ;
        Left = 704, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "Çı\<kış", ;
        Name = "CmdExit"
 
    ADD OBJECT cmdCalendar AS commandbutton WITH ;
        Top = 360, ;
        Left = 1, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "\<Takvim", ;
        Name = "CmdCalendar"
 
    ADD OBJECT cmdInBox AS commandbutton WITH ;
        Top = 320, ;
        Left = 1, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "\<Gelen K.", ;
        Name = "CmdInBox"
 
    ADD OBJECT cmdSent AS commandbutton WITH ;
        Top = 320, ;
        Left = 91, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "Gön\<Derilmiş", ;
        Name = "CmdSent"
 
    ADD OBJECT cmdContact AS commandbutton WITH ;
        Top = 360, ;
        Left = 92, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "\<Adres Defteri", ;
        Name = "CmdContact"
 
   ADD OBJECT cmdoutbox AS commandbutton WITH ;
        Top = 320, ;
        Left = 182, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "Gide\<N K", ;
        Name = "Cmdoutbox"
 
  ADD OBJECT cmddrafts AS commandbutton WITH ;
        Top = 320, ;
        Left = 272, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "Taslak\<Lar", ;
        Name = "Cmddrafts"
 
    Add Object cmdNewMail As CommandButton With ;
        Top = 320, ;
        Left =362 , ;
        Height = 27, ;
        Width = 84, ;
        Caption = "Yeni \<Mail", ;
        Name = "cmdNewMail"
 
    Add Object cmdNewTask As CommandButton With ;
        Top = 320, ;
        Left =452 , ;
        Height = 27, ;
        Width = 84, ;
        Caption = "Yeni Göre\<v", ;
        Name = "cmdNewTask"
 
    Add Object cmdNewContact As CommandButton With ;
        Top = 320, ;
        Left =542 , ;
        Height = 27, ;
        Width = 84, ;
        Caption = "Yeni \<Kişi", ;
        Name = "cmdNewContact"
 
    Add Object cmdNewAppointment As CommandButton With ;
        Top = 320, ;
        Left =632 , ;
        Height = 27, ;
        Width = 110, ;
        Caption = "Yeni \<Toplantı", ;
        Name = "cmdNewAppointment"
 
Add Object cmdSendandReceive As CommandButton With ;
        Top = 360, ;
        Left = 362 , ;
        Height = 27, ;
        Width = 110, ;
        Caption = "\<Gönder-Al", ;
        Name = "cmdSendandReceive"
 
ADD OBJECT cmdnotes AS commandbutton WITH ;
        Top = 360, ;
        Left = 183, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "N\<Otlar", ;
        Name = "Cmdnotes"
 
ADD OBJECT cmdtasks AS commandbutton WITH ;
        Top = 360, ;
        Left = 273, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "Gorevle\<R", ;
        Name = "Cmdtasks"
 
    ADD OBJECT olecontrol1 AS olecontrol WITH ;
        Top = 0, ;
        Left = 0, ;
        Height = 316, ;
        Tooltiptext = "İşlemler için Sağ Mouse", ;
        Width = 790, ;
        Name = "Olecontrol1", ;
        OleClass = "OVCtl.OVCtl.1"
&&-------------------------------------- procedures -----------------------------
PROCEDURE init
&&With Thisform
&&  .SetAll("mousepointer",99,"commandbutton")
&&  .SetAll("mouseicon",Sys(5)+Sys(2003)+"\bmp\fare.cur","commandbutton")
&&Endwith
 
ENDPROC
 
    PROCEDURE cmdExit.Click
        ThisForm.Release()
    ENDPROC
 
 
    Procedure cmdNewMail.Click
       Thisform.olecontrol1.NewMessage()
    ENDPROC
 
    Procedure cmdNewTask.Click
       Thisform.olecontrol1.NewTask()
    Endproc
 
    Procedure cmdNewContact.Click
       Thisform.olecontrol1.NewContact()
    ENDPROC
 
    Procedure cmdNewAppointment.Click
       Thisform.olecontrol1.NewAppointment()
    Endproc
 
 
    PROCEDURE cmdCalendar.Click
        ThisForm.OleControl1.Folder = "CALENDAR"
        ThisForm.Caption = "OutLook Takvim"
        ThisForm.Refresh()
    ENDPROC
 
    PROCEDURE cmdInBox.Click
        ThisForm.OleControl1.Folder = "INBOX"
        ThisForm.Caption = "OutLook Gelen Kutusu"
        ThisForm.Refresh()
    ENDPROC
 
    PROCEDURE cmdSent.Click
        ThisForm.OleControl1.Folder = "SENT ITEMS"
        ThisForm.Caption = "OutLook Gönderilmiş Öğeler"
        ThisForm.Refresh()
    ENDPROC
 
    PROCEDURE cmdContact.Click
        ThisForm.OleControl1.Folder = "CONTACTS"
        ThisForm.Caption = "OutLook Adres Defteri"
        ThisForm.Refresh()
    ENDPROC
 
    PROCEDURE cmdoutbox.Click
        ThisForm.OleControl1.Folder = "Outbox"
        ThisForm.Caption = "OutLook Giden Kutusu"
        ThisForm.Refresh()
    ENDPROC
 
    PROCEDURE cmddrafts.Click
        ThisForm.OleControl1.Folder = "Drafts"
        ThisForm.Caption = "OutLook Taslaklar"
        ThisForm.Refresh()
    ENDPROC
 
    PROCEDURE cmdnotes.Click
        ThisForm.OleControl1.Folder = "Notes"
        ThisForm.Caption = "OutLook Notlar"
        ThisForm.Refresh()
    ENDPROC
 
    PROCEDURE cmdtasks.Click
        ThisForm.OleControl1.Folder = "Tasks"
        ThisForm.Caption = "OutLook Görevler"
        ThisForm.Refresh()
    ENDPROC
 
Procedure cmdSendandReceive.Click
        Thisform.olecontrol1.SendAndReceive()
    Endproc
 
    PROCEDURE olecontrol1.Init
        This.Folder = "InBox"
    ENDPROC
 
ENDDEFINE
http://www.soykansoft.com/images/twitter.jpghttp://www.soykansoft.com/images/wp.jpghttp://www.soykansoft.com/images/blogger.jpg

8

Re: mail için activex

Benim amacım hiçbir ara program kullanmadan doğrudan POP3 üzerinden e-posta sunucusundan e-postaları okumak oradan indirmek ve oradakini silmek, müşterimiz outlook veya başka bir posta programı kullanmak zorunda kalmadan bu işi çözmek istiyor. Paralı olan bazı component'ler var gerçi ama öncelikle kendimin yazıp yazamıyacağımı öğrenmek istiyorum.
Başka componentler aldığında kontroler senin elinde olmadığı için çok tercih etmiyorum, tabii iş çok karmaşık olmaya başlarsa o zaman bir comonent almak zorunda kalırız. Nede olsa Amerikayı tekrar keşf etmeye gerek yok.

9

Re: mail için activex

Cetin,
Blat diye ara. Sanirim onun dll'i isini gorur.

Yen yaz 1907'ye yolla FB gelsin evinde yensin.
(sonra salaklar ciksin alin terine şike desin)

10

Re: mail için activex

cetinbasoz yazdı:

Cetin,
Blat diye ara. Sanirim onun dll'i isini gorur.


ama bu gördüğüm kadarıyla komut satırından çalışıyor. geriye hata filan döndürmüyor sanırım?

Haksızlıklar karşısında susanlar, dilsiz şeytanlardır!
www.metinemre.com

11

Re: mail için activex

Teşekkürler,

Wiki içinde "Get Pop Email" buldum bence çok güzel.
mswinsock.winsock kullanıyor.

http://fox.wikis.com/wc.dll?Wiki~GetPopEmail~VFP

12

Re: mail için activex

cetinyasar yazdı:

Benim amacım hiçbir ara program kullanmadan doğrudan POP3 üzerinden e-posta sunucusundan e-postaları okumak oradan indirmek ve oradakini silmek, müşterimiz outlook veya başka bir posta programı kullanmak zorunda kalmadan bu işi çözmek istiyor. Paralı olan bazı component'ler var gerçi ama öncelikle kendimin yazıp yazamıyacağımı öğrenmek istiyorum.
Başka componentler aldığında kontroler senin elinde olmadığı için çok tercih etmiyorum, tabii iş çok karmaşık olmaya başlarsa o zaman bir comonent almak zorunda kalırız. Nede olsa Amerikayı tekrar keşf etmeye gerek yok.


sanırım aradigin bu

Visual Fox Pro
1

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
* Converted to VFP by William Steinford.

* Date: Feb 9, 2003
* This VFP Class definition is based on the C++ class definition
* found at [url]http://www.codeguru.com/internet/pop3_protocol_class_wrapper.shtml[/url]
* written originally by Asif Rasheed (aasif@khi.compol.com)
 
#DEFINE CRLF CHR(13)+CHR(10)
 
* Test Code:
OX=CREATE("popemail")
OX.SERVERNAME=INPUTBOX("Gimme Your POP SERVER","Hi","pop.mail.yahoo.com")
OX.USER=INPUTBOX("Gimme Your User Name","Hi","username")
OX.PASSWORD=INPUTBOX("Gimme Your Password","Hi","password")
 
?"Trying to Connect..."
IF NOT OX.CONNECT()
 ? "Error Connecting:"+OX.ERRORMESSAGE
ELSE
 ?? "Connected!"
 ? "Stat Check..."
 IF OX.STATISTICS()
  STRTOFILE(OX.SERVERRESPONSE,'ServerStat.txt')
  ? "ServerResponse: "+TRAN(OX.SERVERRESPONSE)
  ? "Number of Emails: "+TRAN(OX.NUMBEROFEMAILS-3)
  ? "Size of Email: "+TRAN(OX.TOTALMAILSIZE)
  ? "Getting Email List..."
  ? OX.LIST()
  ? "Total Messages: "+TRAN(OX.NUMBEROFEMAILS)
  IF OX.NUMBEROFEMAILS>0
   ? 'First Email:'
   FOR LNI = 1 TO OX.NUMBEROFEMAILS
    ? OX.RETRIEVE(LNI)
    LCEMAIL = OX.MSGCONTENTS
    STRTOFILE('----Email#'+TRAN(LNI)+'--------'+CRLF ;
     +LCEMAIL+CRLF,'c:\data\email\Email.txt',.T.)
   ENDFOR
* ? ox.MsgContents
  ELSE
   ? "No Emails!"
  ENDIF
 ELSE
  ? "Failed STAT check!"
 ENDIF
 OX.DISCONNECT()
ENDIF
 
#DEFINE CONNECTION_CHECK 0
#DEFINE USER_CHECK 1
#DEFINE PASSWORD_CHECK 2
#DEFINE QUIT_CHECK 3
#DEFINE DELETE_CHECK 4
#DEFINE RSET_CHECK 5
#DEFINE STAT_CHECK 6
#DEFINE NOOP_CHECK 7
#DEFINE LIST_CHECK 8
#DEFINE RETR_CHECK 9
#DEFINE VBSTRING 8
#DEFINE TIME_OUT 5
 
*/////////////////////////////////////////////////////////////////////////////
DEFINE CLASS POPEMAIL AS CUSTOM
 ERRORMESSAGE = ""
 PASSWORD = ""
 USER = ""
 
 SERVERPORT = 110
 SERVERNAME = ""
 
 MSGCONTENTS = ""
 TOTALMAILSIZE = 0
 NUMBEROFEMAILS = 0
 CONNECTED = .F.
 
 SERVERRESPONSE = ''
 OCXSOCKET = .NULL.
 DIMENSION SIZEOFMSG[1]
 
*!* CString GetErrorMessage(); // If there is any error this will return it method
*!* CString GetPassword(); // Getting Password stored in class
*!* void SetPassword(CString& Password); // Setting Password in class
*!* CString GetUser(); // Getting user name stored in class
*!* void SetUser(CString& User); // Setting user name in class
*!* CString GetHost(); // Getting Host name (email server name) stored in class
*!* void SetHost(CString& Host); // Setting Host name (email server name) in class
*!* BOOL Connect(); // Connecting to email server
*!* int GetTotalMailSize(); // it returns the Total Mail Size
*!* int GetNumberOfMails(); // It return the number of mails
*!* CString GetMsgContents();
*!* BOOL Statistics(); // issue the STAT command on email server
*!* BOOL Retrieve(int MsgNumber); // Getting any particular mail message
*!* BOOL Reset(); // issue the reset command on email server
*!* int GetMessageSize(int MsgNumber); // Return a size of any particular mail
*!* BOOL Noop(); // issue the NOOP command on email server
*!* BOOL Disconnect(); // issue the QUIT command on email server
*!* BOOL Delete(int& MsgNumber); // Deleteing a particular message from email server
*!* BOOL Connect(CString& Host, CString& User, CString& Password);
 
 PROCEDURE INIT
 THIS.OCXSOCKET = CREATE('mswinsock.winsock')
ENDPROC
 
 FUNCTION CONNECT(SERVERNAME, PCUSER, PCPASSWORD) && Boolean
 LOCAL LCSERVERNAME,LCUSER,LCPASSWORD,LNTIME
 LCSERVERNAME = ALLTRIM( IIF( VARTYPE(PCSERVERNAME)='C', PCSERVERNAME, THIS.SERVERNAME ) )
 LCUSER = ALLTRIM( IIF( VARTYPE(PCUSER)='C', PCUSER, THIS.USER ) )
 LCPASSWORD = IIF( VARTYPE(PCPASSWORD)='C', PCPASSWORD, THIS.PASSWORD )
 
 THIS.OCXSOCKET.CONNECT(LCSERVERNAME,THIS.SERVERPORT) && 110 Pop3 Port
 LNTIME = SECONDS()
 DO WHILE THIS.OCXSOCKET.STATE <> 7
* ?"Waiting to connect..."
  INKEY(0.01)
* ?"state="+tran(THIS.ocxSocket.State)
  IF SECONDS() - LNTIME > TIME_OUT
   THIS.ERRORMESSAGE = "Server cannot be connected"
   RETURN .F.
  ENDIF
 ENDDO
 CONNECTED = .T.
* ?"State="+tran(THIS.ocxSocket.State)
 IF NOT THIS.CHECKRESPONSE(CONNECTION_CHECK)
  RETURN .F.
 ENDIF
 
 IF NOT THIS.SENDMESSAGEOK( "USER "+LCUSER, USER_CHECK )
  RETURN .F.
 ENDIF
 IF NOT THIS.SENDMESSAGEOK( "PASS "+LCPASSWORD, PASSWORD_CHECK )
  RETURN .F.
 ENDIF
 RETURN .T.
ENDFUNC
 
 FUNCTION DELETE(PNMSGNUMBER)
 IF NOT THIS.SENDMESSAGEOK( "DELE "+TRAN(PCMSGNUMBER), DELETE_CHECK )
  RETURN .F.
 ENDIF
 RETURN .T.
ENDFUNC
 
 FUNCTION NOOP
 IF NOT THIS.SENDMESSAGEOK( "NOOP ", NOOP_CHECK )
  RETURN .F.
 ENDIF
 RETURN .T.
ENDFUNC
 
*// Return the Msg Size for given msg number
 FUNCTION GETMESSAGESIZE(PNMSGNUMBER)
 IF ALEN(THIS.SIZEOFMSG) <= PNMSGNUMBER
  RETURN 0
 ENDIF
 RETURN THIS.SIZEOFMSG[MsgNumber+1]
ENDFUNC
 
 FUNCTION RESET()
 IF NOT THIS.SENDMESSAGEOK( "RSET ", RSET_CHECK )
  RETURN .F.
 ENDIF
 RETURN .T.
ENDFUNC
 
*// MsgContents will hold the msg body
 FUNCTION RETRIEVE(PNMSGNUMBER)
 IF NOT THIS.SENDMESSAGEOK( "RETR "+TRAN(PNMSGNUMBER), RETR_CHECK )
  RETURN .F.
 ENDIF
 RETURN .T.
ENDFUNC
 
 FUNCTION STATISTICS()
 IF NOT THIS.SENDMESSAGEOK( "STAT ", STAT_CHECK )
  RETURN .F.
 ENDIF
 RETURN .T.
ENDFUNC
 
 FUNCTION LIST
 IF NOT THIS.SENDMESSAGEOK( "LIST ", LIST_CHECK )
  RETURN .F.
 ENDIF
 RETURN .T.
ENDFUNC
 
 FUNCTION DISCONNECT()
* ?"Trying to Disconnect..."
 IF NOT THIS.SENDMESSAGEOK( "QUIT ", QUIT_CHECK )
  RETURN .F.
 ENDIF
* ??" Disconnected."
 RETURN .T.
ENDFUNC
 
 FUNCTION SENDMESSAGEOK( PCMSG, PNTYPE )
* wsprintf (buf, "USER %s\r\n", (LPCSTR) User)
* ?"(out) "+pcMsg
 THIS.OCXSOCKET.SENDDATA(PCMSG+CRLF)
 IF NOT THIS.CHECKRESPONSE(PNTYPE)
  RETURN .F.
 ENDIF
 RETURN .T.
ENDFUNC
 
 FUNCTION CHECKRESPONSE(RESPONSETYPE)
 LOCAL BUF
 BUF =THIS.READDATA()
 THIS.SERVERRESPONSE =BUF
 *?buf
 DO CASE
 CASE RESPONSETYPE=CONNECTION_CHECK
  IF BUF="-ERR"
   THIS.ERRORMESSAGE ="Bad Connection"
   RETURN .F.
  ENDIF
 CASE RESPONSETYPE=USER_CHECK
  IF BUF="-ERR"
   THIS.ERRORMESSAGE ="Bad User Name"
   RETURN .F.
  ENDIF
 CASE RESPONSETYPE=PASSWORD_CHECK
  IF BUF="-ERR"
   THIS.ERRORMESSAGE ="Bad Password"
   RETURN .F.
  ENDIF
 CASE RESPONSETYPE=QUIT_CHECK
  IF BUF="-ERR"
   THIS.ERRORMESSAGE ="Error occurred during QUIT"
   RETURN .F.
  ENDIF
 CASE RESPONSETYPE=DELETE_CHECK
  IF BUF="-ERR"
   THIS.ERRORMESSAGE ="Error occurred during DELE"
   RETURN .F.
  ENDIF
 CASE RESPONSETYPE=RSET_CHECK
   IF BUF="-ERR"
    THIS.ERRORMESSAGE ="Error occurred during RSET"
    RETURN .F.
  ENDIF
 CASE RESPONSETYPE=STAT_CHECK
  IF BUF="-ERR"
   THIS.ERRORMESSAGE ="Error occurred during STAT"
   RETURN .F.
  ELSE
   EMAILNUMBER =.T.
   LNI =1
   LCSAMP =SUBSTR(BUF,LNI,1)
   DO WHILE LCSAMP#CHR(0) AND LNI<1000 && '\0'
    IF (LCSAMP=CHR(9) OR LCSAMP=' ') && *p == '\t' || *p == ' ')
     IF (EMAILNUMBER == .T.)
      THIS.NUMBEROFEMAILS = Val(SubStr(BUF, LNI))  && New
      EMAILNUMBER = .F.
     ELSE
      THIS.TOTALMAILSIZE = Val(SubStr(BUF, LNI))  && New
      RETURN .T.
     ENDIF
    ENDIF
    LNI = LNI + 1
    LCSAMP = SUBSTR(BUF,LNI,1)
   ENDDO
  ENDIF
 CASE RESPONSETYPE=NOOP_CHECK
  IF BUF="-ERR"
   THIS.ERRORMESSAGE = "Error occurred during NOOP"
   RETURN .F.
  ENDIF
 CASE RESPONSETYPE=LIST_CHECK
  IF BUF="-ERR"
   THIS.ERRORMESSAGE = "Error occurred during LIST"
   RETURN .F.
  ELSE
* Buf = THIS.ReadData()
   LNI = 1
   LCSAMP = SUBSTR(BUF,LNI,1)
   LNLINE = 1
   DO WHILE LNI <= Len(BUF)   &&LCSAMP#'.' AND LNI<1000 && '\0' && New: no check for . (RFC STD53)
    IF LCSAMP=CHR(13)
     LNLINE = LNLINE + 1
    ENDIF
    IF LNLINE > 1
     IF (LCSAMP=CHR(9) OR LCSAMP=' ') && *p == '\t' || *p == ' ')
      DIMENSION THIS.SIZEOFMSG[ alen(THIS.SizeOfMsg)+1 ]
      THIS.SIZEOFMSG[alen(THIS.SizeOfMsg)] = VAL(SUBSTR(BUF,LNI))
*? " Email #"+tran(alen(THIS.SizeOfMsg)-1)+" size="+tran(THIS.SizeOfMsg[alen(THIS.SizeOfMsg)])
     ENDIF
    ENDIF
    LNI = LNI + 1
    LCSAMP = SUBSTR(BUF,LNI,1)
   ENDDO
   THIS.NUMBEROFEMAILS = ALEN(THIS.SIZEOFMSG)-1
  ENDIF
 CASE RESPONSETYPE=RETR_CHECK
  IF BUF="-ERR"
   THIS.ERRORMESSAGE = "Error occurred during RETR"
   RETURN .F.
  ELSE
   THIS.MSGCONTENTS = BUF+THIS.READDATA()
  ENDIF
 ENDCASE
 RETURN .T.
ENDFUNC
 
 FUNCTION READDATA
 LOCAL CMSGIN, LNTIME
 LNTIME = SECONDS()
 DO WHILE THIS.OCXSOCKET.BYTESRECEIVED = 0
* ?"Waiting to Receive data..."
  INKEY(0.2)
  IF SECONDS() - LNTIME > TIME_OUT
* ?"Timed Out"
   RETURN ''
  ENDIF
 ENDDO
 ***CMSGIN = REPL(CHR(0),10000) && chr(0),10000)
 
* ?"(in) Bytes Received: "+tran(THIS.ocxSocket.BytesReceived)
* THIS.ocxSocket.Receive(buf, len(buf))
 
 * Fixed a bug with messages longer than the buffer size
 
 ***IF THIS.OCXSOCKET.STATE=7
 *** THIS.OCXSOCKET.GETDATA(@CMSGIN,VBSTRING)
 ***ENDIF
 
    DOEVENTS
 
    lcBuffer = REPL(CHR(0),10000)
*   lcMsgIn = ""  && Here and below should be cMsgIn.
    cMsgIn = ""
    IF THIS.oSocket.State = 7
        DO WHILE THIS.oSocket.BytesReceived > 0
            THIS.oSocket.GETDATA(@lcBuffer,vbString)
            cMsgIn =  cMsgIn + lcBuffer
            INKEY(0.1)
        ENDDO
    ENDIF
 
* cMsgIn = LEFT( cMsgIn, AT(chr(0),cMsgIn) )
* ?"(in) Data Read: ("+tran(len(cMsgIn))+","+tran(THIS.ocxSocket.BytesReceived)+" bytes) "+cMsgIn
 RETURN CMSGIN
ENDFUNC
 
 PROCEDURE DESTROY
 DODEFAULT()
 IF THIS.CONNECTED
  THIS.DISCONNECT()
 ENDIF
ENDPROC
ENDDEFINE
http://www.soykansoft.com/images/twitter.jpghttp://www.soykansoft.com/images/wp.jpghttp://www.soykansoft.com/images/blogger.jpg

13

Re: mail için activex

soykan,
osocket nesnesini bulamayıp hata veriyor bu kod...

Haksızlıklar karşısında susanlar, dilsiz şeytanlardır!
www.metinemre.com

14

Re: mail için activex

evet sad test etmeden post etmistim kodun yazari ile irtibata gecip problemi aktaririm

http://www.soykansoft.com/images/twitter.jpghttp://www.soykansoft.com/images/wp.jpghttp://www.soykansoft.com/images/blogger.jpg

15

Re: mail için activex

metin yazdı:

soykan,
osocket nesnesini bulamayıp hata veriyor bu kod...


osocket yerine OCXSOCKET kullanmanız gerekiyor
ben denedim çok iyi çalışıyor. Sanırım yazım hatası var.

Son düzenleyen, cetinyasar (05.01.2007 07:15:04)

16

Re: mail için activex

bilgi icin tesekkur kodlari dikkatli incelememistim

http://www.soykansoft.com/images/twitter.jpghttp://www.soykansoft.com/images/wp.jpghttp://www.soykansoft.com/images/blogger.jpg

17

Re: mail için activex

PUBLIC oform1
oform1=NEWOBJECT("form1")
  WITH oform1
    .setall("fontsize",8,"commandbutton")
   ENDWITH 
oform1.Show
oform1.showtips=.t.
RETURN
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
DEFINE CLASS form1 AS form

    Height = 400
    Width = 790
    DoCreate = .T.
    Caption = "MS Outlook Integration"
    Name = "Form1"
    autocenter=.t.

    ADD OBJECT cmdExit AS commandbutton WITH ;
        Top = 360, ;
        Left = 704, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "Çı\<kış", ;
        Name = "CmdExit"

    ADD OBJECT cmdCalendar AS commandbutton WITH ;
        Top = 360, ;
        Left = 1, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "\<Takvim", ;
        Name = "CmdCalendar"

    ADD OBJECT cmdInBox AS commandbutton WITH ;
        Top = 320, ;
        Left = 1, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "\<Gelen K.", ;
        Name = "CmdInBox"

    ADD OBJECT cmdSent AS commandbutton WITH ;
        Top = 320, ;
        Left = 91, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "Gön\<Derilmiş", ;
        Name = "CmdSent"

    ADD OBJECT cmdContact AS commandbutton WITH ;
        Top = 360, ;
        Left = 92, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "\<Adres Defteri", ;
        Name = "CmdContact"

   ADD OBJECT cmdoutbox AS commandbutton WITH ;
        Top = 320, ;
        Left = 182, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "Gide\<N K", ;
        Name = "Cmdoutbox"

  ADD OBJECT cmddrafts AS commandbutton WITH ;
        Top = 320, ;
        Left = 272, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "Taslak\<Lar", ;
        Name = "Cmddrafts"

    Add Object cmdNewMail As CommandButton With ;
        Top = 320, ;
        Left =362 , ;
        Height = 27, ;
        Width = 84, ;
        Caption = "Yeni \<Mail", ;
        Name = "cmdNewMail"

    Add Object cmdNewTask As CommandButton With ;
        Top = 320, ;
        Left =452 , ;
        Height = 27, ;
        Width = 84, ;
        Caption = "Yeni Göre\<v", ;
        Name = "cmdNewTask"

    Add Object cmdNewContact As CommandButton With ;
        Top = 320, ;
        Left =542 , ;
        Height = 27, ;
        Width = 84, ;
        Caption = "Yeni \<Kişi", ;
        Name = "cmdNewContact"

    Add Object cmdNewAppointment As CommandButton With ;
        Top = 320, ;
        Left =632 , ;
        Height = 27, ;
        Width = 110, ;
        Caption = "Yeni \<Toplantı", ;
        Name = "cmdNewAppointment"

Add Object cmdSendandReceive As CommandButton With ;
        Top = 360, ;
        Left = 362 , ;
        Height = 27, ;
        Width = 110, ;
        Caption = "\<Gönder-Al", ;
        Name = "cmdSendandReceive"

ADD OBJECT cmdnotes AS commandbutton WITH ;
        Top = 360, ;
        Left = 183, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "N\<Otlar", ;
        Name = "Cmdnotes"

ADD OBJECT cmdtasks AS commandbutton WITH ;
        Top = 360, ;
        Left = 273, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "Gorevle\<R", ;
        Name = "Cmdtasks"

    ADD OBJECT olecontrol1 AS olecontrol WITH ;
        Top = 0, ;
        Left = 0, ;
        Height = 316, ;
        Tooltiptext = "İşlemler için Sağ Mouse", ;
        Width = 790, ;
        Name = "Olecontrol1", ;
        OleClass = "OVCtl.OVCtl.1"
&&-------------------------------------- procedures -----------------------------
PROCEDURE init
&&With Thisform
&&    .SetAll("mousepointer",99,"commandbutton")
&&    .SetAll("mouseicon",Sys(5)+Sys(2003)+"\bmp\fare.cur","commandbutton")
&&Endwith

ENDPROC

    PROCEDURE cmdExit.Click
        ThisForm.Release()
    ENDPROC


    Procedure cmdNewMail.Click
       Thisform.olecontrol1.NewMessage()
    ENDPROC

    Procedure cmdNewTask.Click
       Thisform.olecontrol1.NewTask()
    Endproc

    Procedure cmdNewContact.Click
       Thisform.olecontrol1.NewContact()
    ENDPROC

    Procedure cmdNewAppointment.Click
       Thisform.olecontrol1.NewAppointment()
    Endproc


    PROCEDURE cmdCalendar.Click
        ThisForm.OleControl1.Folder = "CALENDAR"
        ThisForm.Caption = "OutLook Takvim"
        ThisForm.Refresh()
    ENDPROC

    PROCEDURE cmdInBox.Click
        ThisForm.OleControl1.Folder = "INBOX"
        ThisForm.Caption = "OutLook Gelen Kutusu"
        ThisForm.Refresh()
    ENDPROC

    PROCEDURE cmdSent.Click
        ThisForm.OleControl1.Folder = "SENT ITEMS"
        ThisForm.Caption = "OutLook Gönderilmiş Öğeler"
        ThisForm.Refresh()
    ENDPROC

    PROCEDURE cmdContact.Click
        ThisForm.OleControl1.Folder = "CONTACTS"
        ThisForm.Caption = "OutLook Adres Defteri"
        ThisForm.Refresh()
    ENDPROC

    PROCEDURE cmdoutbox.Click
        ThisForm.OleControl1.Folder = "Outbox"
        ThisForm.Caption = "OutLook Giden Kutusu"
        ThisForm.Refresh()
    ENDPROC

    PROCEDURE cmddrafts.Click
        ThisForm.OleControl1.Folder = "Drafts"
        ThisForm.Caption = "OutLook Taslaklar"
        ThisForm.Refresh()
    ENDPROC

    PROCEDURE cmdnotes.Click
        ThisForm.OleControl1.Folder = "Notes"
        ThisForm.Caption = "OutLook Notlar"
        ThisForm.Refresh()
    ENDPROC

    PROCEDURE cmdtasks.Click
        ThisForm.OleControl1.Folder = "Tasks"
        ThisForm.Caption = "OutLook Görevler"
        ThisForm.Refresh()
    ENDPROC

Procedure cmdSendandReceive.Click
        Thisform.olecontrol1.SendAndReceive()
    Endproc
 
    PROCEDURE olecontrol1.Init
        This.Folder = "InBox"
    ENDPROC

ENDDEFINE


hocam bu kod hata veriyor
OLE error code 0*80040113 invalid class string

sorun bendemi acaba başka kimseden ses çıkmadığına göre

18

Re: mail için activex

http://www.fox4um.com/downloads/outlctlx.zip

bu dosyayi indirip system32 ye kopyalayıp register edip tekrar dene

http://www.soykansoft.com/images/twitter.jpghttp://www.soykansoft.com/images/wp.jpghttp://www.soykansoft.com/images/blogger.jpg

19

Re: mail için activex

soykanozcelik yazdı:

http://www.fox4um.com/downloads/outlctlx.zip

bu dosyayi indirip system32 ye kopyalayıp register edip tekrar dene


hocam register nasıl yapıyoruz

20

Re: mail için activex

selam;

başlattan çalıştırı aç.
regsvr32 c:\test\outlctlx.dll
şeklinde yapabilirsin.

Bilmediğin Neyse Yanıldığındır.

21

Re: mail için activex

mrduyar yazdı:

selam;

başlattan çalıştırı aç.
regsvr32 c:\test\outlctlx.dll
şeklinde yapabilirsin.


sağol hocam

22

Re: mail için activex

bu kezde OLE error code 0*80070005 access is denied sad

23

Re: mail için activex

cetinbasoz yazdı:

Cetin,
Blat diye ara. Sanirim onun dll'i isini gorur.


Blat için teşekkürler... smile

Blat sayesinde Foxpro Dos altındaki programım da e-mail gönderebiliyor. Hataları alabilmek için >hata.txt şeklinde çalıştırıyorum.

Yalnız çok ilginç bir özelliği var. Komut satırı parametelerini öğrenmeye çalışırken birşeyi farkettim. sahte bir mail adresiyle de mail çekmene izin veriyor. Sanırım spam mailleri Blat benzeri programlarla gönderiyorlar. Nasıl oluyor bu iş? Mail server nasıl izin veriyor kendi üzerinden sahte bir mail adresine. Çok tuhaf. -smtp diye bir mail adresi bile verebildim... big_smile

Haksızlıklar karşısında susanlar, dilsiz şeytanlardır!
www.metinemre.com

24

Re: mail için activex

metin yazdı:

Blat sayesinde Foxpro Dos altındaki programım da e-mail gönderebiliyor.


FPD ile e-mail göndermekmi?  Banada lazım bu. Hemen bakıyorum.
Bilgi için teşekkürler.

25

Re: mail için activex

metin yazdı:

sahte bir mail adresiyle de mail çekmene izin veriyor. Sanırım spam mailleri Blat benzeri programlarla gönderiyorlar. Nasıl oluyor bu iş? Mail server nasıl izin veriyor kendi üzerinden sahte bir mail adresine. Çok tuhaf. -smtp diye bir mail adresi bile verebildim... big_smile


Spam mail göndermek için birçok program var. Yanlış bilmiyorsam hepsi sahte mail adresi kullanmanı sağlıyor.