• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

dosya seçip mail gönderme işlemi hk.

Katılım
17 Kasım 2009
Mesajlar
295
Excel Vers. ve Dili
2010
merhaba arkadaşlar aşağıdaki kod ile mail gönderebiliyorum fakat dosya ekine basıp masaüstünden herhangi bir dosya seçip mail göndermek istiyorum. bu konuda yardıma ihtiyacım var.
Private Sub gonder_Click()
On Error Resume Next

Set GmailMesaj = CreateObject("CDO.Message")
Set CdoMesaj = CreateObject("CDO.Configuration")
Set AAA = CdoMesaj.Fields
schema = "http://schemas.microsoft.com/cdo/configuration/"
With AAA
.Item(schema & "sendusing") = 2
.Item(schema & "smtpserver") = "smtp.gmail.com"
.Item(schema & "smtpserverport") = 465
.Item(schema & "smtpauthenticate") = 1
.Item(schema & "sendusername") = anamenu.formail
.Item(schema & "sendpassword") = anamenu.formsifre
.Item(schema & "smtpusessl") = 1
.Item(msConfigURL & "/smtpusessl") = True
.Item(msConfigURL & "/smtpauthenticate") = 1
.Update
End With
With GmailMesaj
.To = anamenu.alicimail
.From = anamenu.alicimail
.Subject = anamenu.konu 'başlık
.HTMLBody = anamenu.acıklama ' GENEL AÇIKLAMA

.Sender = ""
.ReplyTo = ""
Set .Configuration = CdoMesaj
SendEmailGmail = .Send
On Error Resume Next
End With
Set GmailMesaj = Nothing
Set CdoMesaj = Nothing
Set AAA = Nothing
Eposta = Empty
schema = vbNullString
MsgBox "mail gönderildi", , " "
End Sub
 

Ekli dosyalar

  • örnek ekran.jpg
    örnek ekran.jpg
    90.9 KB · Görüntüleme: 12
arkadaşlar commandbutton ve textbox2 button ekledim aşağıdaki kodu yazdım gönder butonu içinede .Attachments.Add .TextBox2.Value yazdım yinede dosya seçiyor fakat maile eklemeden gönderiyor.

Private Sub CommandButton5_Click()
Dim txt
txt = Application.GetOpenFilename("Excel Files (*.xlsx), *.xlsx, Excel macro files (*.xlsm),*.xlsm", 2)
Me.TextBox2 = txt
End Sub
 
merhaba yardım edebilecek kimse yokmu
 
Geri
Üst