By default the Campus SMTP Relay service (https://kb.wisc.edu/14051) for programmatic sending without authentication is already registered for Shared Hosting servers and subnets.
By default, php's mail() function calls the mail program (either sendmail or qmail), and directly opens the network connection to the destination mail server. Sending email this way may not give you robust sender verification that services like Gmail have begun to start to require. (More details here: https://it.wisc.edu/it-community/email-authenticity)
In order to get PHP to use the campus smtp relay, two things need to occur:
1.) The PHP code needs to be able to send with SMTP. If you are using something like Wordpress, there are SMTP plugins available, also here are some examples for using PHP to send with the SMTP relay:
2.) Use this SMTP configuration (more details here: https://kb.wisc.edu/29362):
SMTP Server: smtp.wiscmail.wisc.eduSMTP Port: 25
ID/Password: This is not used. Please leave blank.
TLS/SSL: Enabled (where possible)
Depending on which Shared Hosting platform you are on, we may need to install a few PECL/pear packages to enable the functionality you desire.
If you need assistance, please let us know if you: 1. Receive a specific error when trying to send the message, AND 2. A way to reproduce the problem, so we can get the correct packages installed for you and reach out via email@example.com