0
votes

How do I send an e-mail to a custom folder in Outlook?

I want the mail to be placed in the custom folder not in the Inbox folder.

I tried this.

Dim moApp = CreateObject("Outlook.Application")
Dim emailDefaultFolder = moApp.GetNameSpace("MAPI").GetDefaultFolder(6) 'Inbox folder
Dim emailCustomFolder = emailDefaultFolder.Folders("Submission") 'Custom Folder
Dim emailNotif = moApp.CreateItem(0)

With emailNotif
    .To = "myemail.mail.net"
    .Subject = "This is a test only."
    .ReadReceiptRequested = True
    .Send()
    
    .Move(emailCustomFolder)

End With
1

1 Answers

1
votes

You cannot invoke any properties or methods after calling Send (which is asynchronous). If you want the sent message to be saved in a folder other than the default Sent Items folder, set the MailItem.SaveSentMessageFolder property before calling Send.