-1

Anyone have any project send email from localhost using PHPMailer for send email ?

I have 2 project using it and now it's stop send email both, it's show message SMTP Error: Could not connect to SMTP host. the same, I think PHPMailer have problem now ?

Any one meeting problem like me or it's just my imagine ?

koe
  • 736
  • 1
  • 12
  • 33

1 Answers1

1

The way you have this setup, it would require an SMTP server running on the localhost to send the messages through. If you don't have an SMTP server running on this localhost, then you can use an external SMTP server to relay the messages through.

Here is a working example:

Having trouble with PHPMailer

Community
  • 1
  • 1
jagmitg
  • 4,236
  • 7
  • 25
  • 59
  • Yes my code is like this too, before it's send email as well, just a few day it's stop send – koe Aug 18 '14 at 08:15
  • @Time Can you enable debug and tell us the messages your receiving: `$mail->SMTPDebug = 1` – jagmitg Aug 18 '14 at 08:20
  • yes after i `$mail->SMTPDebug =1` it's show message `SMTP ERROR: Failed to connect to server: php_network_getaddresses: getaddrinfo failed: The requested name is valid, but no data of the requested type was found. (0) SMTP Error: Could not connect to SMTP host` – koe Aug 18 '14 at 08:31
  • @Time have you tried configuring your SMTP to listen to Port 587 or 25 – jagmitg Aug 18 '14 at 08:39
  • port 587 , SMTPSecure tls – koe Aug 18 '14 at 08:41
  • Try following this: http://stackoverflow.com/questions/25321030/phpmailercan-not-send-email – jagmitg Aug 18 '14 at 08:41
  • is mine, it's my question! I try it already but no result yet – koe Aug 18 '14 at 08:43