Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 364793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:28:21+00:00 2026-05-12T13:28:21+00:00

I tried to accomplish this via a MailMessage.Headers.Set call, in VB.net. See below: Dim

  • 0

I tried to accomplish this via a MailMessage.Headers.Set call, in VB.net. See below:

    Dim objMail As MailMessage
    Dim objSMTPClient As SmtpClient

    objMail = New MailMessage()
    objSMTPClient = New SmtpClient()

    objMail.From = New MailAddress(MY_EMAIL_ADDRESS)
    objMail.To.Add(New MailAddress(TEST_EMAIL_ADDRESS))
    objMail.Headers.Set("Date", "09 Jan 1999 17:23:42 -0400")'date in the past'

    objMail.Subject = "The Subject"
    objMail.Body = "The Body"

    objSMTPClient.Port = 25
    objSMTPClient.Host = HOST_IP
    objSMTPClient.Credentials = New System.Net.NetworkCredential(MY_EMAIL_ADDRESS, txtPassword.Text)
    objSMTPClient.Send(objMail)

I confirmed that the objMail.Headers.Set call is actually working – if I get the value afterwards, it has been successfully changed. My problem is that when I receive the e-mail in the TEST_EMAIL_ADDRESS’s Outlook, the date is 2009 everywhere, not 1999. Right there in the Outlook interface, and also in the header, which I access via the “Options” item in the context menu for that e-mail.

What am I doing wrong? I have a feeling I missed something obvious…

To be clear: I am not doing this with malicious intent. I am working on an e-mail integration component that utilizes both UIDs and a “Last processed” date to locate the first new e-mail to integrate. I want to test cases where multiple e-mails have the exact same date/time – as the e-mail integration module should handle those situations flawlessly. If I could simply fake the date this way, I could send as many e-mails as I wanted that matches a certain date/time, rather than trying to send them with an automated script – hoping they will all be received within the same second. It seems I’ll need to take another approach, though.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T13:28:22+00:00Added an answer on May 12, 2026 at 1:28 pm

    Adding on to @Lasse V. Karlsen’s note, I think that most likely the SMTP server is overriding what you put into the message in code. In all honesty, why would you even need to make an email look like it was sent in the past? I can’t think of a single reason that isn’t dishonest at least or malicious at worst.

    So, it would make sense to me that the server would overwrite this header if it looked suspicious. I don’t know if that’s what’s actually happening, but I would bet that @Lasse V. Karlsen is correct.

    If so, a possible solution would be to change the date on the SMTP server to some date in the past (if you control the server and are able to do so).

    Still, I am wondering why you would want to even do this. Can you elaborate?

    Added

    @Lasse V. Karlsen – I think you should post your note as the answer so you get the credit for it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've tried to accomplish this with regex but it seems not to be working
Tried something like this: HttpApplication app = s as HttpApplication; //s is sender of
I tried scouring the web for help on this issue, but there are so
I tried this XAML: <Slider Width=250 Height=25 Minimum=0 Maximum=1 MouseLeftButtonDown=slider_MouseLeftButtonDown MouseLeftButtonUp=slider_MouseLeftButtonUp /> And this
I tried the following code in LINQPad and got the results given below: List<string>
There doesn't seem to be any tried and true set of best practices to
After asking this question: Clean URLs for search query? I tried something with mod_rewrite:
I tried Googling this but not sure what's the best thing to look for.
Alright now, I have been searching everywhere for a way to accomplish this and
Tried to map it from Preferences -> Settings -> Keyboard, but the key combo

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.