I want to send an email from A to B,with HEADER and CONTENT through gmail.
How to do that by PHP?<
You need to go to GMAIL settings and add new alias.
You will be asked SMTP information, which is basically useless, since you are using SMTP to send email, BUT the catch is that if your alias is on Google Suite domain it will be added just with simple email confirmation!
Once you have the alias there, you can change "From" header in your SMTP email.
NOTE: You cannot change the "From" address to whatever@dude.com, that's just how Gmail works and is the reason it's trusted.