1

Konu: mail olarak gönderme

"Gönder" tuşuna basıldığında daha önceden tanımlanmış olan bir mail adresine otomatik olarak mail göndermek istiyorum.

Gönderi sırasında programın örneğin. "/LISTE/rapor.xls" liste klasöründe bulunan rapor.xls dosyası da eklenıp gönderilecek.

Yapılabilirmi ?

Teşekkürler...

2

Re: mail olarak gönderme

Visual Fox Pro
Local lcErrReturn,lcKimden,lcKime,lcFile

 
lcKimden = "soykan@soykansoft.com"
lcKime = "soykan@soykansoft.com"
m.lcFile = "d:\vfptemp\test.xls"
 
SendViaCDOSYS(@lcErrReturn, m.lcKimden, m.lcKime, "Konu", "Mesaj",m.lcFile , "cc", "bc", "mail.soykansoft.com", "soykan@soykansoft.com", "XXXXX", .t.)
 
If Empty(lcErrReturn)
    Messagebox("'" + "' Başarıyla Gönderildi", 64, "SoykanSoft - CDOSYS Mail Sending System")
Else
    Messagebox("'" + "' Gönderilemedi.  Sebebi:" + Chr(13) + lcErrReturn, 64, "SoykanSoft - CDOSYS Mail Sending System")
Endif
 
*******************************************
Function SendViaCDOSYS(tcReturn, tcFrom, tcTo, tcSubject, tcBody, taFiles, tcCC, tcBCC, tcMailServer, tcUserName, tcPassword, tlHTMLFormat)
*******************************************
 
Local lcSchema, loConfig, loMsg, loAtt, lnCountAttachments
 
Try
    lcSchema = "http://schemas.microsoft.com/cdo/configuration/"
 
    loConfig = Createobject("CDO.Configuration")
 
    With loConfig.Fields
        .Item(lcSchema + "smtpserverport") = 587 &&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 = [Error: ] + Str(loError.ErrorNo) + Chr(13) + ;
        [LineNo: ] + Str(loError.Lineno) + Chr(13) + ;
        [Message: ] + loError.Message + Chr(13) + ;
        [Procedure: ] + loError.Procedure + Chr(13) + ;
        [Details: ] + loError.Details + Chr(13) + ;
        [StackLevel: ] + Str(loError.StackLevel) + Chr(13) + ;
        [LineContents: ] + loError.LineContents
Finally
    Release loConfig, loMsg
    Store .Null. To loConfig, loMsg
Endtry
EndFunc

3

Re: mail olarak gönderme

Outlook Express, outlook ile mi çalışıyor ?

4

Re: mail olarak gönderme

hayir bu default mail client aramaz direkt gonderir... windows2000 den beri olan \windows\system32\CDOSYS.DLL i kullanir

5

Re: mail olarak gönderme

Soykan,
Cimbom'u tebrik ediyorum.
Neşenden yardım saçıyorsun - sevgiler - ali

VFP9 SP2

6

Re: mail olarak gönderme

COMPILE DE

HATA DOLDURDU
**********************

Try
Error in line 21: Unrecognized command verb.
Catch To loError
Error in line 62: Unrecognized command verb.
Finally
Error in line 70: Unrecognized command verb.
Endtry
Error in line 73: Unrecognized command verb.
Local lcErrReturn,lcKimden,lcKime,lcFile
Error in line 76: Statement is not in a procedure.
lcKimden = "soykan@soykansoft.com"
Error in line 78: Statement is not in a procedure.
lcKime = "onder@birlesikgumrukleme.com.tr"
Error in line 79: Statement is not in a procedure.
m.lcFile = "\gunluk.xls"
Error in line 80: Statement is not in a procedure.
SendViaCDOSYS(@lcErrReturn, m.lcKimden, m.lcKime, "Konu", "Mesaj",m.lcFile , "cc", "bc", "mail.soykansoft.com", "soykan@soykansoft.com", "XXXXX", .t.)
Error in line 82: Statement is not in a procedure.
If Empty(lcErrReturn)
Error in line 84: Statement is not in a procedure.
Messagebox("'" + "' Başarıyla Gönderildi", 64, "SoykanSoft - CDOSYS Mail Sending System")
Error in line 85: Statement is not in a procedure.
Else
Error in line 86: Statement is not in a procedure.
Messagebox("'" + "' Gönderilemedi.  Sebebi:" + Chr(13) + lcErrReturn, 64, "SoykanSoft - CDOSYS Mail Sending System")
Error in line 87: Statement is not in a procedure.
Endif
Error in line 88: Statement is not in a procedure.
Try
Error in line 96: Unrecognized command verb.
Catch To loError
Error in line 137: Unrecognized command verb.
Finally
Error in line 145: Unrecognized command verb.
Endtry
Error in line 148: Unrecognized command verb.

7

Re: mail olarak gönderme

kodu copy + paste ederken "alıntı yap" tikla oradan kopyala yapistir yap muhtemelen bozuk satirlar var

8

Re: mail olarak gönderme

konuka yazdı:

Soykan,
Cimbom'u tebrik ediyorum.
Neşenden yardım saçıyorsun - sevgiler - ali

Ben de tebrik ederim. Devlet yardimiyla da olsa bir galibiyet almayi basardilar:) 10 yil yeter onlara.

9

Re: mail olarak gönderme

onders yazdı:

Outlook Express, outlook ile mi çalışıyor ?

Outlook a falan gerek yok ama bir mail posta hesabına ihtiyacın var.
mesela "mail.onders.com" gibi.

10

Re: mail olarak gönderme

csmtpauth.superonline.com
u kullanabiliyormuyuz ?

11

Re: mail olarak gönderme

dene smile gmail smtp lerini de kullanabilirsin gmail hesabin varsa yada hotmail