# Cron job and email settings

**URL:** <https://forum.mautic.org/t/cron-job-and-email-settings/5974>\
**Category:** Product Support\
**Created:** [March 9, 2016, 6:02pm UTC](https://forum.mautic.org/t/cron-job-and-email-settings/5974 "2016-03-09T18:02:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cristofor](https://avatars.discourse-cdn.com/v4/letter/c/13edae/32.png) [@cristofor](https://forum.mautic.org/u/cristofor)\
**Post date:** [March 9, 2016, 6:02pm UTC](https://forum.mautic.org/t/cron-job-and-email-settings/5974/1 "2016-03-09T18:02:55Z")

</div>

Hello,  
  
  
  
I am a newbe in using Mautic, wich looks great by the way.  
  
I am trying to set conjobs and for the leadlist updates and mautic campaigns, i am receiving an error via email cronjob notiffication: “Could not open input file: /home/cristi/public\_html/mautic/app/console mautic:campaigns:trigger --env=prod”  
  
  
  
I set up the cronjob as follows:  
  
/usr/local/bin/php -q “/home/cristi/public\_html/mautic/app/console mautic:leadlists:update --env=prod”  
  
  
  
/usr/local/bin/php -q “/home/cristi/public\_html/mautic/app/console mautic:campaigns:update --env=prod”  
  
  
  
/usr/local/bin/php -q “/home/cristi/public\_html/mautic/app/console mautic:campaigns:trigger --env=prod”  
  
  
  
Is something wrong there? ( iset this with help from my hosting provider)  
  
Also i have problems setting up email client. I want to use Sparkpost (my domain is “ready to send” with them). Email settings inside mautic is set as follow:  
  
  
  
Service to send mail through  
  
Other SMTP Server  
  
  
  
Test connection Send test email  
  
SMTP host  
  
[smtp.sparkpostmail.com](http://smtp.sparkpostmail.com)  
  
SMTP port  
  
587  
  
SMTP encryption type  
  
TLS  
  
  
  
SMTP authentication mode  
  
Login  
  
  
  
Username for the selected mail service  
  
SMTP\_Injection  
  
  
  
How should email be handled?  
  
Send immediately  
  
  
  
…i am receiving this error:  
  
Connection could not be established with host [smtp.sparkpostmail.com](http://smtp.sparkpostmail.com) [Connection timed out #110] Log data: ++ Starting Swift\_SmtpTransport !! Connection could not be established with host [smtp.sparkpostmail.com](http://smtp.sparkpostmail.com) [Connection timed out #110] (code: 0)  
  
++ Starting Swift\_SmtpTransport !! Connection could not be established with host [smtp.sparkpostmail.com](http://smtp.sparkpostmail.com) [Connection timed out #110] (code: 0)  
  
  
  
I am not good in coding so any help will be like gold ![:)]( ":)")  
  
  
  
Thanks

---

<div class="post-metadata">

**Author:** ![jfgrissom](https://avatars.discourse-cdn.com/v4/letter/j/e47774/32.png) [@jfgrissom](https://forum.mautic.org/u/jfgrissom)\
**Post date:** [April 18, 2016, 1:08pm UTC](https://forum.mautic.org/t/cron-job-and-email-settings/5974/2 "2016-04-18T13:08:15Z")

</div>

Looks like you can’t connect to their host:

I just ran a quick check to see if their service is listening on the address:port you mentioned and it is from where I sit.

If you are behind a network that can’t connect the host you may need a firewall (or proxy host) setup to send emails through sparkspost. (I’m setting this up now using mautic and sparkpost. I’ll post here if I have anything useful to add to this.)

```auto
# nc -vz smtp.sparkpostmail.com 587
found 0 associations
found 1 connections:
     1:	flags=82<CONNECTED,PREFERRED>
	outif en0
	src 192.168.64.176 port 54404
	dst 54.69.82.117 port 587
	rank info not available
	TCP aux info available

Connection to smtp.sparkpostmail.com port 587 [tcp/submission] succeeded!
```

---

<div class="post-metadata">

**Author:** ![cristofor](https://avatars.discourse-cdn.com/v4/letter/c/13edae/32.png) [@cristofor](https://forum.mautic.org/u/cristofor)\
**Post date:** [March 9, 2016, 6:02pm UTC](https://forum.mautic.org/t/cron-job-and-email-settings/5974/3 "2016-03-09T18:02:55Z")

</div>

Hello,

I am a newbe in using Mautic, wich looks great by the way.  
I am trying to set conjobs and for the leadlist updates and mautic campaigns, i am receiving an error via email cronjob notiffication: “Could not open input file: /home/cristi/public\_html/mautic/app/console mautic:campaigns:trigger --env=prod”

I set up the cronjob as follows:  
/usr/local/bin/php -q “/home/cristi/public\_html/mautic/app/console mautic:leadlists:update --env=prod”

/usr/local/bin/php -q “/home/cristi/public\_html/mautic/app/console mautic:campaigns:update --env=prod”

/usr/local/bin/php -q “/home/cristi/public\_html/mautic/app/console mautic:campaigns:trigger --env=prod”

Is something wrong there? ( iset this with help from my hosting provider)  
Also i have problems setting up email client. I want to use Sparkpost (my domain is “ready to send” with them). Email settings inside mautic is set as follow:

Service to send mail through  
Other SMTP Server

Test connection Send test email  
SMTP host  
[smtp.sparkpostmail.com](http://smtp.sparkpostmail.com)  
SMTP port  
587  
SMTP encryption type  
TLS

SMTP authentication mode  
Login

Username for the selected mail service  
SMTP\_Injection

How should email be handled?  
Send immediately

…i am receiving this error:  
Connection could not be established with host [smtp.sparkpostmail.com](http://smtp.sparkpostmail.com) [Connection timed out #110] Log data: ++ Starting Swift\_SmtpTransport !! Connection could not be established with host [smtp.sparkpostmail.com](http://smtp.sparkpostmail.com) [Connection timed out #110] (code: 0)  
++ Starting Swift\_SmtpTransport !! Connection could not be established with host [smtp.sparkpostmail.com](http://smtp.sparkpostmail.com) [Connection timed out #110] (code: 0)

I am not good in coding so any help will be like gold 🙂

Thanks
