Hallo,
ich habe folgendes Problem. Ich konnte unter Access 2010 über Outlook 2010 eine Email aus Postfach Nummer 2 versenden mit dem Absender von Postfach 2. Nun nutze ich Outlook 2013 und habe das Problem, das immer vom Absender Postfach 1 versendet wird, egal was ich mache. Einzig, ich ändere das Standardpostfach hilft. Meine Frage ist daher, wurde was geändert in 2013? Es hilft auch nicht, das Konto zu definieren, oder die Mailadresse einzutragen.
Jemand eine Idee?
ich habe folgendes Problem. Ich konnte unter Access 2010 über Outlook 2010 eine Email aus Postfach Nummer 2 versenden mit dem Absender von Postfach 2. Nun nutze ich Outlook 2013 und habe das Problem, das immer vom Absender Postfach 1 versendet wird, egal was ich mache. Einzig, ich ändere das Standardpostfach hilft. Meine Frage ist daher, wurde was geändert in 2013? Es hilft auch nicht, das Konto zu definieren, oder die Mailadresse einzutragen.
Jemand eine Idee?
VB.NET-Quellcode
- Set DB = CurrentDb
- On Error Resume Next
- Dim OutlookApp As Object
- Set OutlookApp = GetObject(, "Outlook.Application")
- If Err <> 0 Then
- Shell "Outlook.exe"
- MsgBox "Bitte warten Sie bis Outlook gestartet ist.", vbOKOnly, "Information"
- Else
- End If
- Dim objApp As Outlook.Application
- Dim objNS As Outlook.NameSpace
- Dim objFolder As Outlook.MAPIFolder
- Dim objDummy As Outlook.MailItem
- Dim objRecip As Outlook.Recipient
- Dim objmail As Outlook.MailItem
- Dim strMsg As String
- Dim strName As String
- On Error Resume Next
- NachrichtText = Me.Body
- Set UserName = Me.frm_main_mail
- Set Computer = Me.frm_main_computername
- Set infektionsdatum = Me.frm_main_datum
- SubjectText = "Computervirenvorfall"
- strName = email@privat.de
- 'strName = "Text"
- Set objApp = CreateObject("Outlook.Application")
- Set objNS = objApp.GetNamespace("MAPI")
- Set objDummy = objApp.CreateItem(olMailItem)
- Set objRecip = objDummy.Recipients.Add(strName)
- objRecip.Resolve
- If objRecip.Resolved Then
- 'MsgBox "Bitte prüfen" & objRecip.Resolve, vbOKOnly, "Information"
- On Error Resume Next
- Set objFolder = objNS.GetSharedDefaultFolder(objRecip, Outlook.OlDefaultFolders.olFolderInbox)
- If Not objFolder Is Nothing Then
- Set objmail = objFolder.Items.Add
- With objmail
- .To = UserName
- .Subject = SubjectText
- .Attachments.Add "\\Virusvorfall.pdf"
- .HTMLBody = NachrichtText
- .HTMLBody = Replace(.HTMLBody, "%Computer%", Computer)
- .HTMLBody = Replace(.HTMLBody, "%infektionsdatum%", infektionsdatum)
- '.display
- .Send
- End With
- End If
- End If
- itemcount = itemcount + 1
- Me.frm_main_angeschrieben = Date
- On Error GoTo 0
- End If
- End If
- End If
- End If