C'è un motivo per cui SwiftMail API per PHP non verrà eseguito su HostGator? Il loro supporto tecnico ha detto di usare il comando mail() e che le connessioni socket alla porta 25 non funzioneranno così sul loro piano di hosting condiviso. Mi sono lamentato e ho detto che quando vai su Google come inviare allegati con mail(), le persone ti dicono di usare SwiftMail. Ho bisogno di inviare file allegati con l'e-mail.HostGator non invia posta tramite API SwiftMail PHP
Il mio codice funziona perfettamente su A2Hosting, ma non su HostGator. Nell'API, sto inviando a localhost sulla porta 25, non usando l'autenticazione, non usando SSL e utilizzando un indirizzo email valido che esiste su questo host (fingere che sia example.com) - [email protected]
L'errore che sto ottenendo è:
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: #0 /home/user/public_html/mywebsite/addons/swiftmail-4.0.3/lib/classes/Swift/Transport/StreamBuffer.php(80): Swift_Transport_StreamBuffer->_establishSocketConnection() #1 /home/user/public_html/mywebsite/addons/swiftmail-4.0.3/lib/classes/Swift/Transport/AbstractSmtpTransport.php(111): Swift_Transport_StreamBuffer->initialize(Array) #2 /home/user/public_html/mywebsite/addons/swiftmail-4.0.3/lib/classes/Swift/Mailer.php(84): Swift_Transport_AbstractSmtpTransport->start() #3 /home/user/public_html/mywebsite/mailer.php(34): Swift_Mailer->send(Object(Swift_Message)) #4 /home/user/public_html/mywebsite/mailer.php(146): Mailer->sendMail() #5 {main} thrown in /home/user/public_html/mywebsite/addons/swiftmail-4.0.3/lib/classes/Swift/Transport/StreamBuffer.php on line 245
Se hai ottenuto SwiftMail API per lavorare su HostGator, si prega di condividere quello che hai fatto.
Questo praticamente si verificherà su qualsiasi account di hosting. Potresti riuscire a eseguire il debug inviando email a noreply (senza dominio.com alla fine), ma non volerà su un account di hosting e dovrai aggiungere non solo il dominio.com, ma anche creare l'account di posta. – Volomike
qualsiasi idea non riesco a inviare posta su hostgator usando il mailer veloce, ma ero in grado di inviare posta da localhost usando il server smtp di gmail, penso che ci sia errore in $ transport = Swift_MailTransport :: newInstance (nome del server in uscita, 25); in questa riga, l'output restituisce false. – shruti