[ ljbm @ 25.09.2015. 08:30 ] @
Code:

Public Function PosaljiOvajReportEmail(strEmail As String, strKomeseSalje As String, strNaslovEmaila As String, strTekstEmaila As String, strReport As String)


    Dim strPass As String
    Dim stDocName2 As String

    On Error GoTo PosaljiOvajReportEmail_Error

    DoCmd.OpenReport strReport, acViewPreview, , , acHidden
    

    DoCmd.OutputTo acOutputReport, strReport, acFormatRTF, "c:\doc\rtf\" & strReport & ".rtf", False, ""
    stDocName2 = "c:\doc\rtf\" & strReport & ".rtf"'

    Dim cdomsg As Object
    Set cdomsg = CreateObject("CDO.message")

    With cdomsg.Configuration.Fields
        .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2    'NTLM method
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
        .Item("http://schemas.microsoft.com/cdo/configuration/smptserverport") = 587 ' 25 ili 465
     '   .Item("http://schemas.microsoft.com/cdo/configuration/smptserverport") = DLookup("OdlazniEmailPort", "tabPostavkePrograma")
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
        .Item("http://schemas.microsoft.com/c...guration/smtpconnectiontimeout") = 20
        .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = strEmail
        .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = DLookup("SifraEmaila", "tabPostavkePrograma")
        .Update
    End With
    
   ' build email parts
    
    With cdomsg
        .To = strKomeseSalje
        .From = strEmail
        .Subject = strNaslovEmaila
        .TextBody = strTekstEmaila
        .AddAttachment stDocName2
        .Send
    
    End With
    Set cdomsg = Nothing
    
    Call MsgBox("E-mail je uspesno poslat !", vbInformation, VerzijaPrograma)

    On Error GoTo 0
    Exit Function

PosaljiOvajReportEmail_Error:

    MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure PosaljiOvajReportEmail of Module basE-mail"
End Function



Dakle, ova funkcija ne radi na Telekomovom ADSL-u.
Ima li neko rešenje ?
[ Zidar @ 06.10.2015. 16:37 ] @
MOzda je lakse da se prvo report izveze u PDF fajl pa da onda taj fajl zakacis kao attachment

Citat:
Sacuvaj Report kao PDF
If memory serves, using the DoCmd.Output method and specifying acOutputReport and acFormatPDF will keep your hyperlinks clickable in the resulting PDF.

If your report is open (and has the focus) the following code should do it:

DoCmd.OutputTo acOutputReport, "", acFormatPDF, MyPath & MyFilename, False


Kako poslati email iz VBA koristeci Outlook http://www.devhut.net/2010/09/03/VBA-outlook-automation/
Code:

---------------------------------------------------------------------------------------
' Procedure : SendEmail
' Author    : CARDA Consultants Inc.
' Website   : http://www.cardaconsultants.com
' Purpose   : Automate Outlook to send emails with or without attachments
' Copyright : The following may be altered and reused as you wish so long as the
'             copyright notice is left unchanged (including Author, Website and
'             Copyright).  It may not be sold/resold or reposted on other sites (links
'             back to this site are allowed).
'
' Input Variables:
' ~~~~~~~~~~~~~~~~
' strTo         To Recipient email address string (semi-colon separated list)
' strSubject    Text string to be used as the email subject line
' strBody       Text string to be used as the email body (actual message)
' bEdit         True/False whether or not you wish to preview the email before sending
' strBCC        BCC Recipient email address string (semi-colon separated list)
' AttachmentPath    single value or array of attachment (complete file paths with
'                   filename and extensions)
'
' Revision History:
' Rev       Date(yyyy/mm/dd)        Description
' **************************************************************************************
' 1         2007-Nov-16             Initial Release
'---------------------------------------------------------------------------------------
Function SendEmail(strTo As String, strSubject As String, strBody As String, bEdit As Boolean, _
                   Optional strBCC As Variant, Optional AttachmentPath As Variant)
'Send Email using late binding to avoid reference issues
   Dim objOutlook As Object
   Dim objOutlookMsg As Object
   Dim objOutlookRecip As Object
   Dim objOutlookAttach As Object
   Dim i As Integer
   Const olMailItem = 0
 
   On Error GoTo ErrorMsgs
 
   Set objOutlook = CreateObject("Outlook.Application")
 
   Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
   With objOutlookMsg
      Set objOutlookRecip = .Recipients.Add(strTo)
      objOutlookRecip.Type = 1
 
      If Not IsMissing(strBCC) Then
        Set objOutlookRecip = .Recipients.Add(strBCC)
        objOutlookRecip.Type = 3
      End If
 
      .Subject = strSubject
      .Body = strBody
      .Importance = 2  'Importance Level  0=Low,1=Normal,2=High
      
      ' Add attachments to the message.
      If Not IsMissing(AttachmentPath) Then
        If IsArray(AttachmentPath) Then
           For i = LBound(AttachmentPath) To UBound(AttachmentPath) - 1
              If AttachmentPath(i) <> "" And AttachmentPath(i) <> "False" Then
                Set objOutlookAttach = .Attachments.Add(AttachmentPath(i))
              End If
           Next i
        Else
            If AttachmentPath <> "" Then
                Set objOutlookAttach = .Attachments.Add(AttachmentPath)
            End If
        End If
      End If
 
      For Each objOutlookRecip In .Recipients
         If Not objOutlookRecip.Resolve Then
            objOutlookMsg.Display
         End If
      Next
 
      If bEdit Then 'Choose btw transparent/silent send and preview send
        .Display
      Else
        .Send
      End If
   End With
 
   Set objOutlookMsg = Nothing
   Set objOutlook = Nothing
   Set objOutlookRecip = Nothing
   Set objOutlookAttach = Nothing
 
ErrorMsgs:
   If Err.Number = "287" Then
      MsgBox "You clicked No to the Outlook security warning. " & _
      "Rerun the procedure and click Yes to access e-mail " & _
      "addresses to send your message. For more information, " & _
      "see the document at http://www.microsoft.com/office" & _
      "/previous/outlook/downloads/security.asp."
      Exit Function
   ElseIf Err.Number <> 0 Then
      MsgBox Err.Number & " - " & Err.Description
      Exit Function
   End If
End Function



AKo ova funkcija ne radi, poslacu ti drugu. ne mogu tacno da nadjem link sa koga sam skinuo funkciju koju ja koristim, ali ovo deluje jako slicno.

[ ljbm @ 17.11.2015. 09:41 ] @
Zidar,
hvala na odgovoru, ali ovde se radi o sasvim drugoj problematici (osim ako izumemo da "DoCmd.OutputTo acOutputReport, "", acFormatPDF, MyPath & MyFilename, False" ne radi u MS ACCESSU 2003)
;-)

Ovde je problem što je TELEKOM "isekao" gore pomenute portove, a sve zbog spama.

Izgleda da je uzrok spam, gomile zarazenih racunara koje ga salju preko tih portova, i onda ceo Telekom opseg dodje na sve moguce black liste pa nastanu problemi.
Posto od korisnika ne mogu da zahtevaju da im racunari budu cisti od virusa, onda su "isekli" te portove.


Što se tiče tvoje funkcije...

Funkciju koju si poslao nisam probao, jer već imam sličnu koja radi, ali obe zahtevaju da već imamo instalran OUTLOOK.

Inače kompletno rešenje koje radi, je malo teže opisati i kada budem imao vremena poslaću bazu sa primerom.

U osnovi koraci su sledeći:

1) Report se konvertuje u PDF (opet napominjem da je u pitanju MS ACCESS 2003) uz pomoć [url=] http://www.lebans.com/reporttopdf.htm [/url]

2) Pre toga Outlook mora biti konfigurisan da bi se izbegla sigurnosna podešavanja pomoću [url=] http://www.everythingaccess.co...-mail-Without-Security-Warning [/url]

3) Onda koristite ovu ili neku drugu funkciju koja šalje e-mail uz pomoću OTLOOUK-a

Ima i varijanta sa Redemption-om ([url=] http://www.dimastr.com/redemption/home.htm [/url]) ali nije baš free


[ 2012 @ 18.11.2015. 04:13 ] @
Ja sam slanje email-a uradio preko Excela (izvestaji su u Excel-u) uz koriscenje Outlook-a i radi savrseno.