Report this

What is the reason for this report?

Email now working with a cron job

Posted on February 20, 2014

Hey all, really having a hard time figuring out what the hell is going on here.

I have setup my droplet to send emails through an SMTP server that is running microsoft exchange.

I have a PHP script that will send an email using mail() and it works fine if I open that script in a browser.

The problem arises when I set up a cron job to trigger that script. Then it doesn’t send.

And worse yet, it doesn’t send to only certain email addresses.

Once again, if I open the same file in a browser, it works fine.

To troubleshoot, I’ve removed everything in the php script except for the mail() line. It still has the same issue.

When I check the mail log, this is what I get:

Feb 20 01:11:32 <my hostname> sm-mta[17139]: s1JNS1Rl014657: to=<Email I’m Sending To>, delay=01:43:31, xdelay=00:00:00, mailer=esmtp, pri=840740, relay=ms15341115.msv1.invalid.outlook.com., dsn=4.0.0, stat=Deferred: Connection timed out with ms15341115.msv1.invalid.outlook.com.

Any ideas on where to go next?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bad title, sorry. Should be Email “Not” working obv.

No Ideas?

You might consider webcron services like easycron.com which will load a specific URL at a given time.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.