Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

501 mail from address must be same as authorization user #92

swiftmailer opened this Issue Sep 2, 2011 · 2 comments


None yet
2 participants
Copy link

ghost commented Sep 2, 2011

when I used the following code to send mail via SMTP, it said '501 mail from address must be same as authorization user
'.how to send mail using different user via SMTP?

setUsername('username') ->setPassword('password') ; //Create the Mailer using your created Transport $mailer = Swift_Mailer::newInstance($transport); ?>

Original creation date: 2011-03-24T01:58:18Z
Original reporter: Maciej Lisiewski
Original ticket:


This comment has been minimized.

Copy link
Collaborator Author

ghost commented Sep 2, 2011

501 is actually SMTP error code coming from your mail server, not Swift Mailer. It indicates currently used username + password pair does not have permissions to send as the different user. To send email as different user use the other user's username and password or reconfigure mail server. If this is an issue with Gmail look here:

Original creation date: 2011-04-11T16:44:14Z
Original reporter: Maciej Lisiewski


This comment has been minimized.

Copy link

mckelvin commented Jun 30, 2016

I find this issue in google and I also find the answer to this issue in .

Create aliases for local usernames (optional)


It's a solution to ssmtp. I guess there's a similar way for swiftmailer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.