How can I manipulate the "from" field in an email and make the "to" user see something different then the actual.
Example:
really from
From: [email protected]
but they see
From: Tremayne "Top Dog" Stamper
I've heard its from manipulating SMTP, but really not sure how accurate that is or how it can be done
At its base, SMTP is just a text based protocol with no real verification. Here's an example:
The "MAIL FROM:" line defines the SMTP envelope sender, and the From: is defined in the message DATA. There are ways to protect against this, but they are defined in the mail server logic, not in the protocol itself.
For instance I, as a mail provider, may require a user to authenticate using a user@domain type username. Then my mail server might require that any mail they send have an envelope-sender and a From: header that matches the user they authenticated as. Additional technologies like DKIM and SPF can help in this area also.
There are a couple of different things to consider here. If you just want to display a different name or e-mail address, set the "From" header of the message (the message from address) to the e-mail address with the display name in brackets as such:
From: Joe Example <[email protected]>
Remember that the "from" line in the message header is only used for display purposes. The actual routing is done by the SMTP envelope address. This is what the SMTP servers actually use to transmit the message between servers. This can be different from the message "from" header. If you have a custom SMTP engine, just have it use one address in the SMTP envelope and a different one in the "from" header on the actual message.
There are a number of legitimate reasons that you might want to do this, but please refrain from nefarious purposes.
Note that a correct syntax example can be found in RFC 5322 - A.2.1
Of course you'll need an SMTP server that allows relaying, which is almost impossible to find... or roll your own (just don't use this knowledge to spam!).
The "really from" address comes from the "from:" dialog in the SMTP conversation.
The "fake from" comes from exploiting the common practice in email clients of displaying the various header fields as laid out in the Data portion of the SMTP conversation. For instance:
If you had left out the "from:" and "to:" lines in the Data portion, it would have displayed the actual envelope sender and recipient.
Note that these sorts of tricks are often looked for by spam filters, and will certainly not make you any permanent friends. Also, this doesn't work on all mail clients (just the most common ones).
Yes, it's by manually setting SMTP headers and is trivial to accomplish. Google it. But don't get caught spamming......
This my 2c straight out of the code - written in C#