Changing the `from` address when sending an email through GMail
问题 I'm trying to use PHP Pear Factory to send emails through GMail in one project. It has been successful, but there is something that is not working 100% properly. I don't know why if I set $headers['From'] = 'from@domain.com' , when I receive the email the From is username@gmail.com. Find below the code: $recipients = 'to@domain.com'; $headers['From'] = 'from@domain.com'; $headers['To'] = 'to@domain.com'; $headers['Subject'] = 'Test message'; $body = 'Test message'; $params["host"] = 'ssl:/