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