Hi,
I've got a question.
What do i need to change in my code so that when my program sends a mail, the recipient will see my programs name by From instead of my name
This is my code:
Sub SendMail(strEmail As String, intResultaat As Integer)
Dim olApp As New Outlook.Application
Dim olNs As Outlook.NameSpace
Dim olMail As Outlook.MailItem
On Error GoTo ErrHandler
Set olApp = CreateObject("Outlook.Application"
Set olNs = olApp.GetNamespace("MAPI"
olNs.Logon
Set olMail = olApp.CreateItem(olMailItem)
olMail.To = strEmail
olMail.Subject = "Diagnostic & Solution Tool Report"
olMail.Body = "Hallo, " & vbCrLf & "Op dit moment levert de door u opgegeven query " & vbCrLf & CStr(intResultaat) & " resultaten op." & vbCrLf & vbCrLf & "Vriendelijke Groeten."
olMail.Send
olNs.Logoff
' olApp.Quit
Set olNs = Nothing
Set olMail = Nothing
Set olApp = Nothing
Exit Sub
ErrHandler:
.....
I love work.
I can just sit and look at it for hours.
I've got a question.
What do i need to change in my code so that when my program sends a mail, the recipient will see my programs name by From instead of my name
This is my code:
Sub SendMail(strEmail As String, intResultaat As Integer)
Dim olApp As New Outlook.Application
Dim olNs As Outlook.NameSpace
Dim olMail As Outlook.MailItem
On Error GoTo ErrHandler
Set olApp = CreateObject("Outlook.Application"
Set olNs = olApp.GetNamespace("MAPI"
olNs.Logon
Set olMail = olApp.CreateItem(olMailItem)
olMail.To = strEmail
olMail.Subject = "Diagnostic & Solution Tool Report"
olMail.Body = "Hallo, " & vbCrLf & "Op dit moment levert de door u opgegeven query " & vbCrLf & CStr(intResultaat) & " resultaten op." & vbCrLf & vbCrLf & "Vriendelijke Groeten."
olMail.Send
olNs.Logoff
' olApp.Quit
Set olNs = Nothing
Set olMail = Nothing
Set olApp = Nothing
Exit Sub
ErrHandler:
.....
I love work.
I can just sit and look at it for hours.