Trying To Spoof An Email Address
Solution 1:
The very short version: This isn't going to work.
Once upon a time, it was reasonably possible to do what you are asking to do. In the old days, when the internet was small and spam did not exist, the receiving server would just trust you. You could just connect to mail.example.com and say you were sending on behalf of someone@example.org, and example.com would just believe you.
But those days are over and done with. Nowadays, SMTP servers are a lot less trusting. So let's go through the problems with your approach:
- You are trying to route your email through outlook.com. outlook.com knows perfectly well that you are
username
and notother_email
. If you want to send email asother_email
, you need to authenticate asother_email
. - You could connect directly to gmail.com, claim to be outlook.com, and try to send the email that way. But Gmail knows you're not outlook.com, because you're missing these things. So it will likely flag your message as spam, bounce it, or even* accept it and then discard it entirely.
You could fix (1) by changing your code, but because of (2), there's little point.
* I do not work on the Gmail team. I am guessing how Gmail would respond to this based solely on public information about how modern email servers are typically configured. YMMV.
Post a Comment for "Trying To Spoof An Email Address"