Skip to main content

AccessTr.neT


makro ile mail göndermek

makro ile mail göndermek

Çözüldü #7
Sn Sledgeab paylaşım için teşekkürler. Saygılar...
Bilgi paylaşıldıkça çoğalır....
Her engel, yaşam koşullarınızı daha iyileştirecek bir fırsattır.


Access için her zaman lazım olacak konu başlıkları listesi


Cevapla
Çözüldü #8
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "TABLO1", Application.CurrentProject.Path & "\DETAY.XLS"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "TABLO2", Application.CurrentProject.Path & "\DETAY.XLS"

' + mail gönderme işlemi

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") = "gmailadresim"
Flds.Item(schema & "sendpassword") = "gmailşifrem"
Flds.Item(schema & "smtpusessl") = 1
Flds.Update
With iMsg
.To = "gid@ecekkişimailad.resi"
.From = "gön@deren.kişi"
.Subject = "konuumuz excelle gönderinimi"
.HTMLBody = "evettt gönderdik gitti aldınızsa bana cepten ulaşın"
.Sender = "ben"
.Organization = "yineben"
.ReplyTo = "yanlışkişiyegitti ise geri gelecek adres"
.AddAttachment Application.CurrentProject.Path & "\DETAY.XLS" 'burda stfile adlı globale atadığımız Excel dosyasının yeri adı"

Set .Configuration = iConf
On Error GoTo 10:
.Send
End With

10:
MsgBox "Kullanılabilir değil, bilgilerinizi kontrol edin."

Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing



Private Sub OUTLOOKGONDER_Click()
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "TABLO1", Application.CurrentProject.Path & "\DETAY.XLS"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "TABLO2", Application.CurrentProject.Path & "\DETAY.XLS"

'Microsoft Outlook xx.x Object Library aktifleştirmeniz gerekli
Dim appOutlook As New Outlook.Application
Set msg = appOutlook.CreateItem(olMailItem)
With msg
.To = "mail@adresim"
.Subject = "strSubject"
.Body = "strBody"
.Attachments.Add Application.CurrentProject.Path & "\detay.xls"
.Display

End With
FX-Etopla
Liste Kutusu Oluşturma
Cevapla
Çözüldü #9
Dim mess_body As String
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)

Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.BodyFormat = olFormatRichText
.To = Me.Email_Address
.Subject = Me.Mess_Subject
.HTMLBody = Me.Mess_Text
If Left(Me.Mail_Attachment_Path, 1) <> "<" Then
.Attachments.Add (Me.Mail_Attachment_Path)
End If
'.DeleteAfterSubmit = True 'This would let Outlook send th note without storing it in your sent bin
.Send
End With
'MsgBox MailOutLook.Body
Exit Sub
email_error:
MsgBox "An error was encountered." & vbCrLf & "The error message is: " & Err.Description
Resume Error_out
Error_out:
FX-Etopla
Liste Kutusu Oluşturma
Cevapla
Çözüldü #10
1. Mesajda hem outlook ile hem gmail ile gönderim
2. Mesajda outlook ile ginderim kodlarıdır.
FX-Etopla
Liste Kutusu Oluşturma
Cevapla
Çözüldü #11
Sn Nihat hocam verdiğiniz değerli bilgiler için teşekkürler. Saygılar...
Bilgi paylaşıldıkça çoğalır....
Her engel, yaşam koşullarınızı daha iyileştirecek bir fırsattır.


Access için her zaman lazım olacak konu başlıkları listesi


Cevapla
Çözüldü #12
selam arkadaşlar
bende bugün örneği ekleyecektim yinede ekleyeyim
verdiğiniz bilgiler için çok çok teşekkür ederim
.rar vt1.rar (Dosya Boyutu: 189,97 KB | İndirme Sayısı: 74)
starturk, 20-06-2009 tarihinden beri AccessTr.neT üyesidir.
Son Düzenleme: 08/02/2010, 17:02, Düzenleyen: starturk.
Cevapla

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

Yorum yapmak için üye olmanız gerekiyor

ya da
Task