Phpmailer SMTP connection error only in a cron job

Avatar
  • Answered
Has anyone experienced "Mailer Error: SMTP Error: Could not connect to SMTP host" using phpmailer but only when run by a cron job. If run directly from a browser no error occurs.
Avatar
avinash
Same problem I am facing. Did any have solution.
Avatar
JeffMa
I have looked into your site and I see that the cron is running your script the same as it is processed as if you were to access the site in a browser. I am not currently seeing this error at all when running it in a command line as a cron would.