This example code does not use an SMTP Server or port name, so it is getting that information from the php.ini file.
In the Universal Email settings, try leaving the SMTP Server and Port Number blank.
leave the From Display Name blank, and set the from address to a valid email address for your domain.