[ 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 ? |