To be able to send (relay) mail over our network (without getting a "550 5.7.1 ... we do not relay" error), you must properly authenticate with the sending mail server.
Within your code you must specify the sending mail server host name, such as: "mail.domain.com" (replace domain.com with your actual domain name); "localhost"; or "127.0.0.1". You can only use "localhost" or "127.0.0.1" as the mail server host name if your web site and e-mail are hosted on the same physical server; therefore it is always best to use "mail.domaincom" (with domain.com being your actual domain name).
Also within your code, you must provide a valid FROM E-mail Address, as well as, the Username and Password for that address. The FROM E-mail Address must be present on the sending mail server and the username and password for the address must be valid on that server. If any of this fails to be true, then you will get a "550 5.7.1 ... we do not relay", which means that you have attempted to send mail over a server without properly authenticating. Our server will not allow unauthenticated mail to be sent (relayed) over our network, as to do so would permit spammers to abuse our network.