[Solved] Opening a new Email from Access
Hi, i have a VBA module which creates a new email from access and populates it with a send to address, subject and message body.
However i have been told to amend any code within this access system so that it points SMTP taffic towards a new SMTP solution.
As my VBA module does not send the email it just opens it on screen for the user to check/amend before sending it, i don't think changes to SMTP should affect my VBA module however i am unsure. Does anyone know whether i need to amend the code for SMTP changes?
Thanks
Jessica
Hi, i have a VBA module which creates a new email from access and populates it with a send to address, subject and message body.
However i have been told to amend any code within this access system so that it points SMTP taffic towards a new SMTP solution.
As my VBA module does not send the email it just opens it on screen for the user to check/amend before sending it, i don't think changes to SMTP should affect my VBA module however i am unsure. Does anyone know whether i need to amend the code for SMTP changes?
Code:
Dim olNS As Outlook.NameSpace
Dim olfolder As Outlook.MAPIFolder
Dim olMailItem As Outlook.MailItem
Dim strBodyText As String
Set olApp = CreateObject("Outlook.Application")
Set olNS = olApp.GetNamespace("MAPI")
Set olfolder = olNS.GetDefaultFolder(olFolderInbox)
Set olMailItem = olfolder.Items.Add("IPM.Note")
olMailItem.Display
strBodyText = "Dear " & Me.IFA_TITLE & " " & Me.IFA_SUR & "," & vbCrLf & vbCrLf & _
With olMailItem
.Subject = "Me.AppRefID & " - " & Me.Title & " " & Me.FirstName & " " & Me.AppName
.To = Me.IFA_EMAIL
.Body = strBodyText
' .Send
End With
Set olMailItem = Nothing
Set olfolder = Nothing
Set olNS = Nothing
Set olApp = Nothing
Jessica
Last edited: