AccessTr.neT
formdaki bilgileri ilgili kişiye eposta olarak gönderme - Baskı Önizleme

+- AccessTr.neT (https://accesstr.net)
+-- Forum: Microsoft Access (https://accesstr.net/forum-microsoft-access.html)
+--- Forum: Access Cevaplanmış Soruları (https://accesstr.net/forum-access-cevaplanmis-sorulari.html)
+--- Konu Başlığı: formdaki bilgileri ilgili kişiye eposta olarak gönderme (/konu-formdaki-bilgileri-ilgili-kisiye-eposta-olarak-gonderme.html)

Sayfalar: 1 2 3 4 5 6


Cvp: formdaki bilgileri ilgili kişiye eposta olarak gönderme - Seruz - 19/10/2010

Outlook vs. olmadan eposta'yı aşağıdaki konuda bulunan örnekle gönderebilirsiniz.

<a href="https://accesstr.net/konu-smtp-hesabiyla-e-mail-gonderme-uygulamasi.html">SMTP Hesabıyla E-mail Gönderme Uygulaması</a>

Tabii, şunu unutmamak lazım, O bilgisayarda Outlook vs. olmasa bile bir mail hesabınızın olması ve
sizde bu mail hesabıyla ilgili bilgilerin (şifre, smtp server vb...) olması gerekiyor.


Cvp: formdaki bilgileri ilgili kişiye eposta olarak gönderme - Seruz - 19/10/2010

Size hem tek hem de toplu gönderim için bir örnek hazırladım.

Kodda smtp, e-mail adresiniz ve şifreniz kısımlarını sizin doldurmanız gerekiyor.
SMTP_Sunucu = "smtp.xxxx.xxx.tr"
Gonderenin_Mail_Adresi = "[email protected]"
Gonderenin_Mail_Sifresi = ""

Private Sub btn_EPOSTA_Click()
If IsNull(Me.eposta) Then
MsgBox "E-posta adresi yok!", vbCritical, "Hata oluştu."
Else
ePOSTA_Gonder
End If
End Sub

Private Sub ePOSTA_Gonder()
On Error GoTo Hata
'---------------------------------------------------------------
Const cdoAnonymous = 0
Const cdoBasic = 1
Const cdoNTLM = 2
Dim objMessage As Object
Dim SMTP_Sunucu, Gonderenin_Mail_Adresi, Gonderenin_Mail_Sifresi, Gonderilecek_Mail_Adresi, strBody
'---------------------------------------------------------------
SMTP_Sunucu = "smtp.xxxx.xxx.tr"
Gonderenin_Mail_Adresi = "[email protected]"
Gonderenin_Mail_Sifresi = ""
Gonderilecek_Mail_Adresi = Me.eposta
If Gonderenin_Mail_Adresi = "" Or Gonderenin_Mail_Sifresi = "" Or Gonderilecek_Mail_Adresi = "" Then
MsgBox "Bilgileriniz eksik olduğu için e-posta gönderilemiyor !", vbCritical, "Hata oluştu."
Exit Sub
End If
'---------------------------------------------------------------
strBody = ""
strBody = strBody & " Sn. " & Me.adısoyadı
strBody = strBody & " Kesintiniz : " & Me.kesinti
strBody = strBody & " Maaş Tutarınız : " & Me.maas_tutar
'---------------------------------------------------------------
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Örnek E-Posta"
objMessage.From = Gonderenin_Mail_Adresi
objMessage.To = Gonderilecek_Mail_Adresi
objMessage.HTMLBody = strBody
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = Gonderenin_Mail_Adresi
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = Gonderenin_Mail_Sifresi
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTP_Sunucu
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objMessage.Configuration.Fields.Update
objMessage.Send
MsgBox "İlgili kişiye e-posta gönderilmiştir.", vbInformation, "İşlem tamam"
Exit Sub
'---------------------------------------------------------------
Hata:
MsgBox "E-posta gönderimi başarısız oldu!", vbCritical, "Hata oluştu."
End Sub

Biraz Html bilginiz varsa, strBody değişkenini Html kodları ile doldurarak,
mesaj içeriğini güzelleştirebilirsiniz.

Örneğin:
strBody = ""
strBody = strBody & "<p>"
strBody = strBody & "<font face='Verdana' size='2'>"
strBody = strBody & "Sn. " & Me.Yetkili.Column(1)
strBody = strBody & "<br><br>"
strBody = strBody & "Satınalma Yetkilisi olduğunuz " & Me.TALEP_EDENIN_ADI & " malzeme satınalma talebinde bulunmuştur."
strBody = strBody & "<br><br>"
strBody = strBody & "Concorde Menü'de 'MALZEME TALEPLERİ' programındaki 'Yetkili Onayı' formunda"
strBody = strBody & "<br>"
strBody = strBody & " malzeme talebine onay verebilir veya talebi iptal edebilirsiniz."
strBody = strBody & "<br><br><br>"
strBody = strBody & "Talep Edilen Malzemeler: (No:" & Me.TALEP_NO & ")"
strBody = strBody & "</font>"
strBody = strBody & "</p>"
strBody = strBody & "<table border='1' cellspacing='0' cellpadding='1' font face='Verdana' size='1' bgcolor='LightBlue'>"
strBody = strBody & "<tr>"
strBody = strBody & "<td><b>&nbsp;Malzeme&nbsp;</b></td>"
strBody = strBody & "<td><b>&nbsp;Miktar&nbsp;</b></td>"
strBody = strBody & "</tr>"
strBody = strBody & "<tr>"
If IsNull(RS.Fields("MLZ_OZELLIK")) Then
strBody = strBody & "<td>&nbsp;" & RS.Fields("MLZ_TANIMI") & "&nbsp;</td>"
Else
strBody = strBody & "<td>&nbsp;" & RS.Fields("MLZ_TANIMI") & "(" & RS.Fields("MLZ_OZELLIK") & ")&nbsp;</td>"
End If
strBody = strBody & "<td align=right>&nbsp;" & RS.Fields("MLZ_TALEP_MIKTARI") & " " & RS.Fields("MLZ_BIRIMI") & "&nbsp;</td>"
strBody = strBody & "</tr>"
strBody = strBody & "</table>"
strBody = strBody & "</font><br><br>"



Cvp: formdaki bilgileri ilgili kişiye eposta olarak gönderme - yturan - 20/10/2010

çok teşekkür ederim...


Cvp: formdaki bilgileri ilgili kişiye eposta olarak gönderme - mustafa_atr - 20/10/2010

Sorununuz çözüldü mü?


Cvp: formdaki bilgileri ilgili kişiye eposta olarak gönderme - yturan - 20/10/2010

sorunum, gmail, hotmail, ve kurumun e-postası ile sanıyorum gönderemiyorm. smtp hizmeti veren bir yerden eposta almam gerekiyor sanırım. alınca çözüleceğini ümit ediyorum. Ama ilgilenmeniz bile büyük bir nezaket teşekkür ediyorum hepinize...


Cvp: formdaki bilgileri ilgili kişiye eposta olarak gönderme - mustafa_atr - 20/10/2010

gmail'in smtp hizmeti var.
Anladığım kadarıyla sorun sizin hiç kodlama bilmiyor olmanız. Bu uygulama için hiç değilse temel düzeyde butona kod nasıl yazılır vb. biliyor olmak gerek.
Siz birde gmail üzerinde nasıl mail gönderileceği ile ilgili şu konuya da bakın belki işinize yarar.