Delete sent email

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.
 
O

OssieMac

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top