You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.2 KiB

Public Class clsMailClient
Dim m_empfaenger As String
Public Sub CreateOutlookMail(mailclient As String, absender As String, empfaenger As String, betreff As String, inhalt As String, attachment As String)
Select Case mailclient
Case "OUTLOOK"
Dim Outl As Object
Outl = CreateObject("Outlook.Application")
If Outl IsNot Nothing Then
Dim omsg As Object
omsg = Outl.CreateItem(0)
omsg.sender = absender
omsg.SentOnBehalfOfName = absender
omsg.ReadReceiptRequested = True
omsg.To = empfaenger
omsg.bcc = ""
omsg.subject = betreff
omsg.body = inhalt
omsg.Attachments.Add(attachment)
omsg.Display(True)
End If
Case "MAPI"
Dim mapi As New MapiMail
mapi.AddAttachment(attachment)
mapi.AddRecipientTo(empfaenger)
mapi.SendMailPopup(betreff, inhalt)
Case Else
MsgBox("Kein Mail-Client verfügbar.")
End Select
End Sub
End Class