Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

VB.NET: Aus einem Prg über Outlook Email versenden

Empfohlene Antworten

Veröffentlicht

Moin,

ich hätte da mal gerne ein Problem:

Ich würde gerne aus einer Applikation (Windows Form) heraus Outlook ansprechen und eine Mail versenden. Hat jemand eine Idee, wie man das am klügsten anstellt?

Ich scheiter da schon an dem Verweis :(

hi,

du brauchst den outlook verweis (verweis hinzufügen -> com -> Microsoft Outlook 11.0 Object Library (falls outlook 2003) oder Microsoft Outlook 10.0 Object Library (falls outlook 2002))

evtl. brauchst du den office verweis auch noch, ich hab den noch mit drin bin mir aber net 100% sicher ob er unbedingt erforderlich ist glaub aber schon, is schon ne zeitlang her *gg*


Public Function startOutlook(ByVal toVal As String, ByVal subjectVal As String, ByVal bodyVal As String)

        'Return a reference to the MAPI layer

        Dim ol As New Outlook.Application()

        Dim ns As Outlook.NameSpace

        Dim fdMail As Outlook.MAPIFolder


        ns = ol.GetNamespace("MAPI")


        'Logs on the user

        'Profile: This is a string value that indicates what MAPI profile to use for logging on. Leave blank if using the currently logged on user, or set to an empty string ("") if you wish to use the default Outlook Profile. 

        'Password: The password for the indicated profile. Leave blank if using the currently logged on user, or set to an empty string ("") if you wish to use the default Outlook Profile password. 

        'ShowDialog: Set to True to display the Outlook Profile dialog box. 

        'NewSession: Set to True to start a new session. Set to False to use the current session. 

        ns.Logon(, , True, True)


        'create a new MailItem object

        Dim newMail As Outlook.MailItem


        'gets defaultfolder for my Outlook Outbox

        fdMail = ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderOutbox)


        'assign values to the newMail MailItem

        newMail = fdMail.Items.Add(Outlook.OlItemType.olMailItem)

        newMail.Subject = subjectVal

        newMail.Body = bodyVal

        newMail.To = toVal

        newMail.SaveSentMessageFolder = fdMail



        'adds it to the draft box

        'newMail.Save()


        'adds it to the outbox

        newMail.Send()



    End Function

bye

True

nix zu danken ;)

und falls doch noch Probleme auftauchen sollten einfach bescheid sagen!

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.