Emailing within Access - 'From' Field?

icezebra

Registered User.
Local time
Today, 17:19
Joined
Feb 12, 2007
Messages
22
I have the following code:

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
can I put something like:
Code:
.From = "BlahBlahBlah"
(I've tried this but it doesn't work)

Am I using the wrong instruction, or is it simply not possible?

Thanks!
 
Microsoft has established security within the mail client that prevents the From being changed programmatically.
 
Ah, I wondered if that was the case. Thanks for your help.
 

Users who are viewing this thread

Back
Top Bottom