502 should be a access denied error. It means in the process of relaying your email to the SMTP server, some middle SMTP server rejects your mail. It's a scheme to design to reduce email spam.
The solution is to use your immediate SMTP server which should be the SMTP server of your ISP. Because blocking does not apply to big SMTP (such as ISP's) server.