Skip to main content

AccessTr.neT


Acessten Mail Gönderme(SMTP+GMAİL)

Acessten Mail Gönderme(SMTP+GMAİL)

#17
Sayın Hocalarım Merhaba.
SMTP Mail gönderimi yapmak istiyorum.
Çalışmadaki Gönder Komutunu kendi uygulamama entegre etmeye çalışıyorum fakat " Mail Gönderimi Başarısız" Hatası alıyorum.

Gönder Butonu tıkladığında kullandığım Olay Yordamı aşağıdaki gibidir.
Debug - Compile yaptığımda hata vermemekte.
Hatayı nerde yaptığım konusunda desteklerinizi rica ederim.

Teşekkür ederim.

Kod:
Private Sub Komut83_Click()
Dim BelgeAdi As String
BelgeAdi = CurrentProject.Path & "\" & Format(Now(), "dd.mm.yyyy") & Me.acilank1 & "DenRaporu.pdf"
DoCmd.OutputTo acOutputReport, "rpr_denk", acFormatPDF, BelgeAdi, False
Dim I As Integer
For I = 1 To SendMail(BelgeAdi)
Next I
'SendMail
End Sub
Function SendMail(BelgeAdi)
Dim objCDOMail As Object
Const cdoAnonymous = 0
Const cdoBasic = 1
Const cdoNTLM = 2
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Mail "
objMessage.From = Me.acilank2 & "<" & "[email protected]" & ">"
objMessage.To = Me.Metin62 & " ; " & acilan10.Column(0) & " ; " & acilan11.Column(0) & " ; " & acilan12.Column(0) & " ; " & acilan13.Column(0) & " ; " & acilan14.Column(0) & " ; " & acilan15.Column(0) & " ; " & acilan16.Column(0) & " ; " & acilan17.Column(0)

objMessage.HTMLBody = "Mail Bildirimi"

On Error GoTo Hata

objMessage.AddAttachment BelgeAdi

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.yandex.com.tr"

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "[email protected]"

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "6*/123"

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

objMessage.Configuration.Fields.Update

objMessage.send
MsgBox "Mail gönderimi başarılı.", vbInformation, "İşlem tamam"
Exit Function
Hata: MsgBox "Mail gönderimi başarısız.", vbCritical, "Hata oluştu."
End Function

Cevapla

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

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
RE: Acessten Mail Gönderme(SMTP+GMAİL) - Yazar: murat dikme - 23/09/2023, 01:49
Task