Re: mail için activex
Soykan Bey merhaba,
Ben de aşağıdaki sistemi kullanarak mail gönderme işlemi yapıyorum.
Yanlız tek sorunum htmlformat=true olduğu halde body içindeki enter, tab vb. kaybediyor. Tüm metni yan yana formatsız gönderiyor. Sorun ne olabilir acaba, siz denediniz mi, sizde nasıl görülüyor ?
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 ProlcFrom = "soykan@soykansoft.com"
lcTo = "soykan@soykansoft.com;soykanozcelik@gmail.com"
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 = "soykan@soykansoft.com" && 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