Is there a reason why the SwiftMail API for PHP will not run on HostGator? Their tech support said it was using the mail () command, and that socket connections to port 25 would not work as they did in terms of co-location. I complained and said that when you send messages about how to send attachments using mail (), people tell you to use SwiftMail. I need to send file attachments by email.
My code works fine on A2Hosting but not HostGator. In the API, I send to localhost on port 25, without using authentication, using SSL, and using a valid email address that exists on this host (pretend it example.com) - noreply@example.com.
The error I get is:
Warning: fsockopen() [function.fsockopen]: unable to connect to localhost:25 (Connection refused) in /home/user/public_html/mywebsite/addons/swiftmail-4.0.3/lib/classes/Swift/Transport/StreamBuffer.php on line 243
Fatal error: Uncaught exception 'Swift_TransportException' with message 'Connection could not be established with host localhost [Connection refused #111]' in /home/user/public_html/mywebsite/addons/swiftmail-4.0.3/lib/classes/Swift/Transport/StreamBuffer.php:245 Stack trace:
If you got the SwiftMail API for working with HostGator, share what you did.
source
share