Sub SendMessage(DisplayMsg As Boolean, Optional AttachmentPath) Dim objOutlook As Outlook.Application Dim objOutlookMsg As Outlook.MailItem Dim objOutlookRecip As Outlook.Recipient Dim objOutlookAttach As Outlook.Attachment Set objOutlook = CreateObject("Outlook.Application") Set objOutlookMsg = objOutlook.CreateItem(olMailItem) With objOutlookMsg Set objOutlookRecip = .Recipients.Add("Tvoje ime i prezime") objOutlookRecip.Type = olTo Set objOutlookRecip = .Recipients.Add("Kome šalješ") objOutlookRecip.Type = olCC Set objOutlookRecip = .Recipients.Add("Kome još") objOutlookRecip.Type = olBCC .Subject = "Automatika-Microsoft Outlook" .Body = "Tekst e-mail." &vbCrLf & vbCrLf .Importance = olImportanceHigh 'Važnost pisma If Not IsMissing(AttachmentPath) Then Set objOutlookAttach = .Attachments.Add(AttachmentPath) End If For Each ObjOutlookRecip In .Recipients objOutlookRecip.Resolve Next If DisplayMsg Then .Display Else .Save .Send End If End With Set objOutlook = Nothing End Sub