Delete sent email

  • Thread starter Thread starter Stephen sjw_ost
  • Start date Start date
S

Stephen sjw_ost

Hello,
I need some help please.
I have found and know how to send email with VBA. What I need to know now
is, how can I prevent the sent email from being saved in my sent folder or
delete folder in Outlook? I am trying to create a process by which I will be
generating a password for someone and need to email that password but I can
not keep the email in any way in my outlook.

Any suggestions or examples would be greatly appreciated.
 
Hi Stephen,

See ".DeleteAfterSubmit = True" in the following extract. My testing
indicates that when deleted it is not moved to the deleted folder.

Set objMail = objOutlook.CreateItem(olMailItem)

With objMail
.To = strTo
.CC = strCC
.BCC = strBCC
.Subject = strSubject
.Body = strBody
.DeleteAfterSubmit = True
.Send
End With
 
Back
Top