- Katılım
- 4 Haziran 2005
- Mesajlar
- 2,746
- Excel Vers. ve Dili
- 2010-2016
Sizin yazdığınız gibi gönderilmiş bir mailin içerisine yazı yazmaya çalışmak olur. Aşağıdaki gibi olması gerekli.
Kod:
Sub Auto_Open()
Call mail_gonder
End Sub
Sub mail_gonder()
sonsatir = Cells(Rows.Count, "A").End(3).Row
On Error Resume Next
For i = 2 To sonsatir
If Cells(i, "X").Value <> "Mail atıldı" Then
isim = Cells(i, "B").Value
Mail = Cells(i, "C").Value
randevutarihi = Cells(i, "O").Value
mailtarihi = CDate(Cells(i, "P").Value)
If Format(Now, "dd.mm.yyyy") = Format(mailtarihi, "dd.mm.yyyy") Then
mesaj = Cells(i, "Z")
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = Mail
.CC = ""
.Subject = "Randevu Hatirlatma"
.HTMLBody = mesaj & .HTMLBody
'Maili otomatik göndermek için .send deki tırnak işaretini kaldırın.
'.Display
.send
End With
Set wrdEdit = Nothing
Set OutMail = Nothing
Set OutApp = Nothing
End If
Cells(i, "X").Value = "Mail atıldı"
End If
Next i
End Sub
