Prevent message to be saved on Sent Items folderSend Email in .NET, with email saved in user's Sent ItemsOutlook MailItem Save/SaveAsLooping over Outlook mail items in “Sent Items” folderSMTP.Send() returns after (or during) an email sending session?VB SQL database INSERT not being savedCreating VB code to extract an email address from the body of a message in OutlookAny Language - Port Listener? [UDP]how to insert checked items from checkedlistbox to SQL database?can't send email in asp.net vb websiteCatch exception when using async/await and Task in VB.Net

How to ask a man to not take up more than one seat on public transport while avoiding conflict?

What are the benefits and disadvantages if a creature has multiple tails, e.g., Kyuubi or Nekomata?

BASH script: How to assign each line of command output to values in an array?

What is the need of methods like GET and POST in the HTTP protocol?

What is this utensil for?

What benefits does the Power Word Kill spell have?

How to find the sum of elements at compile time?

Performance for simple code that converts a RGB tuple to hex string

What is the meaning of "heutig" in this sentence?

Is it impolite to ask for halal food when traveling to and in Thailand?

How do I deal with too many NPCs in my campaign?

Will Proving or Disproving of any of the following have effects on Chemistry in general?

Why is the missed-approach course for the "RNAV (GNSS) - A" approach to runway 28 at ENSB shaped all funny?

My 15 year old son is gay. How do I express my feelings about this?

Does wetting a beer glass change the foam characteristics?

Cut a cake into 3 equal portions with only a knife

Where does an unaligned creature's soul go after death?

Where Does VDD+0.3V Input Limit Come From on IC chips?

Is it a good idea to leave minor world details to the reader's imagination?

reverse a list of generic type

How does IBM's 53-bit quantum computer compare to classical ones for cryptanalytic tasks?

Does the Orange League not count as an official Pokemon League, making the Alolan League his first-ever win?

Are actors contractually obligated to certain things like going nude/ Sensual Scenes/ Gory Scenes?

What do you do if you have developments on your paper during the long peer review process?



Prevent message to be saved on Sent Items folder


Send Email in .NET, with email saved in user's Sent ItemsOutlook MailItem Save/SaveAsLooping over Outlook mail items in “Sent Items” folderSMTP.Send() returns after (or during) an email sending session?VB SQL database INSERT not being savedCreating VB code to extract an email address from the body of a message in OutlookAny Language - Port Listener? [UDP]how to insert checked items from checkedlistbox to SQL database?can't send email in asp.net vb websiteCatch exception when using async/await and Task in VB.Net






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















My Office 365 Sent Items folder is plenty of copies of the messages my website sends upon visitors requests.
I wonder if System.Net.Mail.MailMessage has any option to prevent the message to save a copy in the Sent Items folder, something like the "Do Not Save" feature of Outlook.



This is my email code (commented my request):



Private Sub SendSimpleMail(MailServerUrl As String, username As String, password As String, From As String, [to] As String, subject As String, body As String)
Dim oSmtpClient As SmtpClient = New System.Net.Mail.SmtpClient(MailServerUrl)
oSmtpClient.UseDefaultCredentials = False
oSmtpClient.Credentials = New System.Net.NetworkCredential(username, password)

Dim oMessage As New System.Net.Mail.MailMessage(From, [to])
oMessage.Subject = subject
oMessage.SubjectEncoding = System.Text.Encoding.UTF8
oMessage.Body = body
oMessage.BodyEncoding = System.Text.Encoding.UTF8
oMessage.IsBodyHtml = True

' oMessage.DoNotSave = true

oSmtpClient.Send(oMessage)
End Sub









share|improve this question


























  • Is there a .DeleteAfterSubmit property on the message. If so set it to True.

    – dbasnett
    Mar 28 at 16:27











  • A pity there is none. This property is only exposed by VBA Outlook mailItem object

    – Matias Masso
    Mar 31 at 16:56











  • fi server is an Exchange server you might be able to use MailItem instead.

    – dbasnett
    Apr 1 at 16:36

















0















My Office 365 Sent Items folder is plenty of copies of the messages my website sends upon visitors requests.
I wonder if System.Net.Mail.MailMessage has any option to prevent the message to save a copy in the Sent Items folder, something like the "Do Not Save" feature of Outlook.



This is my email code (commented my request):



Private Sub SendSimpleMail(MailServerUrl As String, username As String, password As String, From As String, [to] As String, subject As String, body As String)
Dim oSmtpClient As SmtpClient = New System.Net.Mail.SmtpClient(MailServerUrl)
oSmtpClient.UseDefaultCredentials = False
oSmtpClient.Credentials = New System.Net.NetworkCredential(username, password)

Dim oMessage As New System.Net.Mail.MailMessage(From, [to])
oMessage.Subject = subject
oMessage.SubjectEncoding = System.Text.Encoding.UTF8
oMessage.Body = body
oMessage.BodyEncoding = System.Text.Encoding.UTF8
oMessage.IsBodyHtml = True

' oMessage.DoNotSave = true

oSmtpClient.Send(oMessage)
End Sub









share|improve this question


























  • Is there a .DeleteAfterSubmit property on the message. If so set it to True.

    – dbasnett
    Mar 28 at 16:27











  • A pity there is none. This property is only exposed by VBA Outlook mailItem object

    – Matias Masso
    Mar 31 at 16:56











  • fi server is an Exchange server you might be able to use MailItem instead.

    – dbasnett
    Apr 1 at 16:36













0












0








0








My Office 365 Sent Items folder is plenty of copies of the messages my website sends upon visitors requests.
I wonder if System.Net.Mail.MailMessage has any option to prevent the message to save a copy in the Sent Items folder, something like the "Do Not Save" feature of Outlook.



This is my email code (commented my request):



Private Sub SendSimpleMail(MailServerUrl As String, username As String, password As String, From As String, [to] As String, subject As String, body As String)
Dim oSmtpClient As SmtpClient = New System.Net.Mail.SmtpClient(MailServerUrl)
oSmtpClient.UseDefaultCredentials = False
oSmtpClient.Credentials = New System.Net.NetworkCredential(username, password)

Dim oMessage As New System.Net.Mail.MailMessage(From, [to])
oMessage.Subject = subject
oMessage.SubjectEncoding = System.Text.Encoding.UTF8
oMessage.Body = body
oMessage.BodyEncoding = System.Text.Encoding.UTF8
oMessage.IsBodyHtml = True

' oMessage.DoNotSave = true

oSmtpClient.Send(oMessage)
End Sub









share|improve this question
















My Office 365 Sent Items folder is plenty of copies of the messages my website sends upon visitors requests.
I wonder if System.Net.Mail.MailMessage has any option to prevent the message to save a copy in the Sent Items folder, something like the "Do Not Save" feature of Outlook.



This is my email code (commented my request):



Private Sub SendSimpleMail(MailServerUrl As String, username As String, password As String, From As String, [to] As String, subject As String, body As String)
Dim oSmtpClient As SmtpClient = New System.Net.Mail.SmtpClient(MailServerUrl)
oSmtpClient.UseDefaultCredentials = False
oSmtpClient.Credentials = New System.Net.NetworkCredential(username, password)

Dim oMessage As New System.Net.Mail.MailMessage(From, [to])
oMessage.Subject = subject
oMessage.SubjectEncoding = System.Text.Encoding.UTF8
oMessage.Body = body
oMessage.BodyEncoding = System.Text.Encoding.UTF8
oMessage.IsBodyHtml = True

' oMessage.DoNotSave = true

oSmtpClient.Send(oMessage)
End Sub






vb.net system.net.mail






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 29 at 16:16









Marc LaFleur

22.6k3 gold badges21 silver badges36 bronze badges




22.6k3 gold badges21 silver badges36 bronze badges










asked Mar 28 at 15:37









Matias MassoMatias Masso

4332 gold badges4 silver badges14 bronze badges




4332 gold badges4 silver badges14 bronze badges















  • Is there a .DeleteAfterSubmit property on the message. If so set it to True.

    – dbasnett
    Mar 28 at 16:27











  • A pity there is none. This property is only exposed by VBA Outlook mailItem object

    – Matias Masso
    Mar 31 at 16:56











  • fi server is an Exchange server you might be able to use MailItem instead.

    – dbasnett
    Apr 1 at 16:36

















  • Is there a .DeleteAfterSubmit property on the message. If so set it to True.

    – dbasnett
    Mar 28 at 16:27











  • A pity there is none. This property is only exposed by VBA Outlook mailItem object

    – Matias Masso
    Mar 31 at 16:56











  • fi server is an Exchange server you might be able to use MailItem instead.

    – dbasnett
    Apr 1 at 16:36
















Is there a .DeleteAfterSubmit property on the message. If so set it to True.

– dbasnett
Mar 28 at 16:27





Is there a .DeleteAfterSubmit property on the message. If so set it to True.

– dbasnett
Mar 28 at 16:27













A pity there is none. This property is only exposed by VBA Outlook mailItem object

– Matias Masso
Mar 31 at 16:56





A pity there is none. This property is only exposed by VBA Outlook mailItem object

– Matias Masso
Mar 31 at 16:56













fi server is an Exchange server you might be able to use MailItem instead.

– dbasnett
Apr 1 at 16:36





fi server is an Exchange server you might be able to use MailItem instead.

– dbasnett
Apr 1 at 16:36












0






active

oldest

votes














Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55401563%2fprevent-message-to-be-saved-on-sent-items-folder%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55401563%2fprevent-message-to-be-saved-on-sent-items-folder%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript