When using Gmail for SMTP, can you set a different "from" address?
12,104
gmail doesn't allow you to use random From addresses. You have to add and validate the address you'd like to use in the gmail settings:
Settings -> Accounts -> Send mail as -> Add another email address you own
Author by
Kirk Beard
Updated on June 05, 2022Comments
-
Kirk Beard almost 2 years
I am using Swift Mailer 406 for sending emails. I connect to my smtp.gmail.com account and then I do:
->setFrom(array($from => $fromname))
But the emails sent got the original gmail account email.
Can I change it?
-
dynamic about 13 yearsthanks. do you know if i can send many emails thru gmail without problems? (they are all legit sent to registered users from my website)
-
David Medenjak about 8 yearsPlease also add an explanation to your answer, since code dumps are often hard to understand