Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
' Module : basSendMail ' Description: ' Procedures : SendMail(strRecipients As String, strCC As String, strBCC As String, strSubject As String, strTextBody As String, strHTMLBody As String, strAttachments As String, Optional eOlImportance As Integer = 1, Optional fDisplay As Boolean = True) As Boolean ' Modified : ' 08/16/13 JV Cleaned with Total Visual CodeTools ' ' -------------------------------------------------- Option Explicit Public Function SendMail(strRecipients As String, strCC As String, strBCC As String, strSubject As String, strTextBody As String, strHTMLBody As String, strAttachments As String, Optional eOlImportance As Integer = 1, Optional fDisplay As Boolean = True) As Boolean ' Comments: Sends a message using the following properties : Recipients, CC, BCC, SubjectBody, Delimiter ' Params : strRecipients List of recipients (TO address) ' strCC List of carbon copy (CC) recipients ' strBCC List of blind carbon copy (BCC) recipients ' strSubject Subject of email ' strTextBody Text Body of email, if any ' strHTMLBody HTML body of email, if any ' strAttachments List of attachment files (separated with the delimiter character which defaults to ;) ' eOIImportance Importance of the email (defaults to olImportanceNormal, can also be olImportanceHigh, olImportanceLow) ' fDisplay True to display the Mail Dialog, False otherwise. Default value is False. ' Returns : True if sent, False if failed ' Source : Total Visual SourceBook On Error GoTo PROC_ERR Dim astrTmpAttachments() As String Dim intCount As Integer Dim strM_strDelimiter As String Dim objOOutlook As Object Dim objOutMailItem As Object Dim objOutAttachments As Object strM_strDelimiter = "," Set objOOutlook = CreateObject("Outlook.Application") ' Assume failure SendMail = False ' Create new instance of Outlook MailItem Object for you to work with. Set objOutMailItem = objOOutlook.CreateItem(0) 'You must use 0 instead of olMailItem with late-binding With objOutMailItem .To = strRecipients .CC = strCC .BCC = strBCC .Subject = strSubject .Body = strTextBody If strHTMLBody <> "" Then .HTMLBody = strHTMLBody .BodyFormat = 2 'olFormatHTML Else .BodyFormat = 1 'olFormatPlain End If .Importance = eOlImportance ' Parse Attachments and Add them to the Attachments Collection If strAttachments <> "" Then Set objOutAttachments = .Attachments astrTmpAttachments = Split(strAttachments, strM_strDelimiter) For intCount = 0 To UBound(astrTmpAttachments) objOutAttachments.Add astrTmpAttachments(intCount), 1 'olByValue Next intCount End If If fDisplay Then .Display End If .Send End With SendMail = True PROC_EXIT: Exit Function PROC_ERR: MsgBox "Error: " & Err.Number & ". " & Err.Description, , "COutlookMail.SendMail" Resume PROC_EXIT End Function