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

Open
swiftmailer opened this Issue Sep 2, 2011 · 2 comments

Comments

Projects
None yet
2 participants
@ghost
Copy link
Collaborator

ghost commented Sep 2, 2011

hi,
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: http://swiftmailer.lighthouseapp.com/projects/21527/tickets/189

@ghost

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: http://mail.google.com/support/bin/answer.py?answer=22370

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

@mckelvin

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 https://wiki.archlinux.org/index.php/SSMTP .

Create aliases for local usernames (optional)

/etc/ssmtp/revaliases
root:username@gmail.com:smtp.gmail.com:587

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.