alttaki kod ile gerekli alanları doldurduğunuzda istediğiniz sayıda mail yollanabilir
test ettim çalışıyor
referansları eklemeyi unutmayın ve ilgili alanlarda hata olmadı taktirde çalışır
saygılarımla
Kod:
'referans
'microsoft cdo for windows 2000 library ekle
Public Sub gonder()
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") = "[email protected]"
Flds.Item(schema & "sendpassword") = "******."
Flds.Item(schema & "smtpusessl") = 1
Flds.Update
With iMsg
.To = "[email protected];[email protected]" 'bu alandan aralarda noktalı virgül ile sınırsız gönderim
.From = "[email protected]"
.Subject = "konu başlığı"
.HTMLBody = "mesaj içerik"
.Sender = "ben"
.Organization = "aaaaaaaaaaa"
.ReplyTo = "yanlışkişiyegitti ise geri gelecek adres"
'.AddAttachment Application.CurrentProject.Path & "C:\rapor.pdf" ' rapor dosyası"
Set .Configuration = iConf
.Send
MsgBox ("Mail gönderildi")
End With
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
End Sub