baydeniro
Altın Üye
- Katılım
- 26 Ocak 2007
- Mesajlar
- 4,625
- Excel Vers. ve Dili
- Ofis 2016
- Altın Üyelik Bitiş Tarihi
- 20-02-2025
Merhaba arkadaşlar. Aşağıda forumdan aldığım, otomatik mail gönderme ile ilgili bir kod mevcuttur. Bu koddaki Add satırı işlev görmüyor. Yani orada adresi verilen dosyayı maile eklemiyor. Bu kodu nasıl düzeltmek gerekir !! Yardımlarınız için teşekkür ederim.
Sub OutlookMailGönder()
Dim OutApp As Object
Dim OutMail As Object
Dim MsgBody As String
On Error Resume Next
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
OutApp.Visible = True
Set OutMail = OutApp.CreateItem(0)
'****************************************************
MsgBody = "Sayfa Güncellenmiştir<br><br><br>" & _
"İyi Çalışmalar."
'****************************************************
With OutMail
.To = "john@yahoo.com"
.CC = "paul@hotmail.com"
.BCC = "belmondo@yahoo.com"
.Subject = "Günlük Satış Raporu"
.HTMLBody = MsgBody
'.Attachments.Add ("C:\Documents and Settings\Belgelerim\Rapor.xls")
'.Display
.Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Sub OutlookMailGönder()
Dim OutApp As Object
Dim OutMail As Object
Dim MsgBody As String
On Error Resume Next
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
OutApp.Visible = True
Set OutMail = OutApp.CreateItem(0)
'****************************************************
MsgBody = "Sayfa Güncellenmiştir<br><br><br>" & _
"İyi Çalışmalar."
'****************************************************
With OutMail
.To = "john@yahoo.com"
.CC = "paul@hotmail.com"
.BCC = "belmondo@yahoo.com"
.Subject = "Günlük Satış Raporu"
.HTMLBody = MsgBody
'.Attachments.Add ("C:\Documents and Settings\Belgelerim\Rapor.xls")
'.Display
.Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub