Skip to main content

AccessTr.neT


Toplu mail gönderme

Toplu mail gönderme

Çözüldü #1
Arkadaşlar;

Ekteki örneği sitemizden indirmiştim. Ne zaman ve hangi konunun altından indirdiğimiz bulamadım.

Bu örnekte biraz değişiklik yapılabilir mi?

İstediğim mailin yanı sıra ekte gönderebilmek.
.rar tmp_28917-örnek-460014913.rar (Dosya Boyutu: 28,3 KB | İndirme Sayısı: 47)
Hayat bu
ölsende yaşamaya mecbursun!
UNUTMA!!!



(hafta sonu mesai olmadığından mesajlardaki çözümleri ancak hafta içi uygulayabiliyorum)
Cevapla
#2
selam
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

aydın3838, 20-12-2009 tarihinden beri AccessTr.neT üyesidir.
Cevapla
#3
Sayın aydın3838
Mail sayısında bir sorun yok. Mail atarken ek gönderebilir miyim? Mesela
"Bu manzarayı gördünüz mü?" Mailine birde resim ekleyip göndermek istiyorum. Veya bir Excel tablosu vs.....
Hayat bu
ölsende yaşamaya mecbursun!
UNUTMA!!!



(hafta sonu mesai olmadığından mesajlardaki çözümleri ancak hafta içi uygulayabiliyorum)
Cevapla
#4
selam
alttaki kodu modüle ekleyin ve deneyip geri dönüş yapın
Kod:
Option Compare Database
Option Explicit
'29,01,2015
'referans microsoft cdo for windows 2000 library ekle
'Dialog microsoft office 11.0 object library
Dim lnk As String
Public Sub gonder()
Dim mesaj
   mesaj = MsgBox("Ek dosya varmı", vbYesNo)
   If mesaj = vbYes Then
       dosyaac
   ElseIf mesaj = vbNo Then
lnk = ""
   End If
 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]"
.From = "[email protected]"
.Subject = "konu başlığı"
.HTMLBody = "mesaj içerik"
.Sender = "A-Yapı'dan"
.Organization = "A-Yapı"
.ReplyTo = ""
.AddAttachment lnk 'dosya gönder
Set .Configuration = iConf
.Send
MsgBox ("Mail gönderildi")
End With
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
lnk = ""
End Sub
Public Sub dosyaac()
Dim dlg As FileDialog
Dim FileName As String
Dim vrtSelectedItem As Variant
Set dlg = Application.FileDialog(msoFileDialogFilePicker)
With dlg
   .AllowMultiSelect = False
   .ButtonName = "Dosya Seç"
   .Filters.Add "Tüm Dosyalar", "*.*"
   .FilterIndex = 0
 .InitialFileName = Application.CurrentProject.Path
   .InitialView = msoFileDialogViewThumbnail
   .TITLE = "A-Yapı Mail" & " Dosya Seç..."
If .Show = True Then
For Each vrtSelectedItem In .SelectedItems
FileName = vrtSelectedItem
Next vrtSelectedItem
lnk = FileName
End If
End With
End Sub

aydın3838, 20-12-2009 tarihinden beri AccessTr.neT üyesidir.
Cevapla
#5
Modüle ekledim fakat "Create Email Message" butonuna basınca herhangi bir değişim olmadı.
Hayat bu
ölsende yaşamaya mecbursun!
UNUTMA!!!



(hafta sonu mesai olmadığından mesajlardaki çözümleri ancak hafta içi uygulayabiliyorum)
Cevapla
#6
Hayırlı Cumalar
Hayat bu
ölsende yaşamaya mecbursun!
UNUTMA!!!



(hafta sonu mesai olmadığından mesajlardaki çözümleri ancak hafta içi uygulayabiliyorum)
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da