I have the following code:
This sends an email through Outlook successfully. However I wondered if it's possible to set who the email is from?
I.e. under the line:
can I put something like:
(I've tried this but it doesn't work)
Am I using the wrong instruction, or is it simply not possible?
Thanks!
Code:
Dim mess_body As String
Dim appOutLook
Dim Email As String
Dim MailOutLook
Email = MPTM
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
mess_body = "Scheme: " + Scheme + vbCrLf
mess_body = mess_body + "Pin: " + Pin + vbCrLf + vbCrLf
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.To = Email
.Subject = "SUMIS Update"
.Body = mess_body
.DeleteAfterSubmit = True
.Send
End With
This sends an email through Outlook successfully. However I wondered if it's possible to set who the email is from?
I.e. under the line:
Code:
With MailOutLook
Code:
.From = "BlahBlahBlah"
Am I using the wrong instruction, or is it simply not possible?
Thanks!