I have to use my google account for gmail and drive services. For drive services now i am using an service account but i cant find any possibility for send emails by service account. Can i login to my account by google api php only using code? I have registered in db my token && refresh_token, in any moment i could use it.
Gmail api does support service accounts, the only issue is that it only works with google workspace gmail accounts, you need to set up domain wide delegation on a workspace account to allow the service account to delignate as a user on the domain.
If you are only accessing your own account you can use Oauth2 and just store the refresh token, your app can just continue to use that to request a new access token whenever it needs.
Another option would be to go though the Gmail smtp server instead, using an apps password.