Skip to main content

AccessTr.neT


makro ile mail göndermek

makro ile mail göndermek

Çözüldü #8
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "TABLO1", Application.CurrentProject.Path & "\DETAY.XLS"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "TABLO2", Application.CurrentProject.Path & "\DETAY.XLS"

' + mail gönderme işlemi

Dim iMsg, iConf, Flds, schema
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
schema = "http://schemas.microsoft.com/cdo/configuration/"
Flds.Item(schema & "sendusing") = 2
Flds.Item(schema & "smtpserver") = "smtp.gmail.com"
Flds.Item(schema & "smtpserverport") = 465
Flds.Item(schema & "smtpauthenticate") = 1
Flds.Item(schema & "sendusername") = "gmailadresim"
Flds.Item(schema & "sendpassword") = "gmailşifrem"
Flds.Item(schema & "smtpusessl") = 1
Flds.Update
With iMsg
.To = "gid@ecekkişimailad.resi"
.From = "gön@deren.kişi"
.Subject = "konuumuz excelle gönderinimi"
.HTMLBody = "evettt gönderdik gitti aldınızsa bana cepten ulaşın"
.Sender = "ben"
.Organization = "yineben"
.ReplyTo = "yanlışkişiyegitti ise geri gelecek adres"
.AddAttachment Application.CurrentProject.Path & "\DETAY.XLS" 'burda stfile adlı globale atadığımız Excel dosyasının yeri adı"

Set .Configuration = iConf
On Error GoTo 10:
.Send
End With

10:
MsgBox "Kullanılabilir değil, bilgilerinizi kontrol edin."

Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing



Private Sub OUTLOOKGONDER_Click()
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "TABLO1", Application.CurrentProject.Path & "\DETAY.XLS"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "TABLO2", Application.CurrentProject.Path & "\DETAY.XLS"

'Microsoft Outlook xx.x Object Library aktifleştirmeniz gerekli
Dim appOutlook As New Outlook.Application
Set msg = appOutlook.CreateItem(olMailItem)
With msg
.To = "mail@adresim"
.Subject = "strSubject"
.Body = "strBody"
.Attachments.Add Application.CurrentProject.Path & "\detay.xls"
.Display

End With
FX-Etopla
Liste Kutusu Oluşturma
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
makro ile mail göndermek - Yazar: starturk - 05/02/2010, 17:31
Cvp: makro ile mail göndermek - Yazar: ozanakkaya - 05/02/2010, 18:06
Cvp: makro ile mail göndermek - Yazar: justcheerful - 28/08/2015, 16:44
Cvp: makro ile mail göndermek - Yazar: tamyoltornistan - 05/02/2010, 21:03
Cvp: makro ile mail göndermek - Yazar: ozanakkaya - 05/02/2010, 21:08
Cvp: makro ile mail göndermek - Yazar: tamyoltornistan - 05/02/2010, 21:14
Cvp: makro ile mail göndermek - Yazar: benremix - 05/02/2010, 22:30
Cvp: makro ile mail göndermek - Yazar: nihatkr - 05/02/2010, 23:41
Cvp: makro ile mail göndermek - Yazar: nihatkr - 05/02/2010, 23:42
Cvp: makro ile mail göndermek - Yazar: nihatkr - 05/02/2010, 23:43
Cvp: makro ile mail göndermek - Yazar: benremix - 06/02/2010, 08:36
Cvp: makro ile mail göndermek - Yazar: starturk - 08/02/2010, 17:00
Cvp: makro ile mail göndermek - Yazar: ozanakkaya - 28/08/2015, 17:09
Task