Private Sub GONDER_Click()
DoCmd.OutputTo acOutputReport, "calisan", "PDFFormat(*.pdf)", CurrentProject.Path & "\DETAY.pdf", False, "", , acExportQualityPrint
' + 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") = "xxxxxxxxxx@gmail.com"
Flds.Item(schema & "sendpassword") = "gmailsifre"
Flds.Item(schema & "smtpusessl") = 1
Flds.Update
With iMsg
.To = "kime"
.From = "kimden"
.Subject = "pdf gönder"
.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.pdf" 'burda stfile adlı globale atadığımız rapor dosyasının yeri adı"
Set .Configuration = iConf
.Send
End With
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
Kill (CurrentProject.Path & "\DETAY.pdf")
End Sub
kodu aşağıdaki ile değiştir.