Getting server to send mail

dmoneyman

New Member
Messages
19
Reaction score
0
Points
0
Is it possible to get the host x10 server to forward some text status a few times a day? Would it be possible to forward this to yahoo mail account?
 

lemon-tree

x10 Minion
Community Support
Messages
1,420
Reaction score
46
Points
48
You can send emails from within PHP scripts by using the mail() function. To get it to do it at regular times in the day you will need to use Cron Jobs
 

dmoneyman

New Member
Messages
19
Reaction score
0
Points
0
I have a cron doing some simple scripting, but no PHP. Any way to get it to work within a cron job without using PHP?
 

garrettroyce

Community Support
Community Support
Messages
5,611
Reaction score
249
Points
63
cron will execute a variety of commands and scripts. I don't know what is allowed or what is not allowed. Seeing as mail() in php is disabled by default, I would think that using cron to send mail would not be allowed by default. I'm pretty sure you can do this with a python script or straight up shell commands.
 

dmoneyman

New Member
Messages
19
Reaction score
0
Points
0
What are you trying to send and from where?

I have a text file in my root dir that has a few lines. I have a cron script that updates this text file a few times throughout the day. I would like that same script to e-mail a copy of the text message to my yahoo account as it runs.
 

Chris Z

Active Member
Messages
5,603
Reaction score
0
Points
36
I'm not real sure how to set up the crons, but the rule in the past has just been that as long as your not running your crons every minute, you should be fine. Even if you're running the crons like once an hour, that won't put too much stress on the server, just as long as it's not a big long complex script, it should be fine to run a few times a day. If you have any more questions about this, just ask.

Thanks,
 

lemon-tree

x10 Minion
Community Support
Messages
1,420
Reaction score
46
Points
48
Basically, you want a php script that will read your file into a variable and then send it to you using the mail() function. If you don't know how to do that then I could put one together for you
 

kursnalista

New Member
Messages
4
Reaction score
0
Points
0
Dear Everybody!
Can somebody to tell me which setting should I make to set up cron jobs.
I read almost everything about these on this forum, and tried several methods, but without success. My php script works fine trought the browser. I dont receive notification e-mails too. I try these settings:
php-cron /home/kurs/public_html/xhtml/cron.php
php-cron /home/kurs/etc/cron.php
php -q /home/kurs/etc/cron.php
/usr/local/bin/php /home/kurs/public_html/xhtml/cron.php
/usr/bin/php-cron /home/kurs/public_html/xhtml/cron.php
Once per a day at different hours and minutes. File permissions changed to 755 and 777 (in etc directory). Put in the first row of file (/home/kurs/public_html/xhtml/cron.php) these parameters:
#!/usr/local/bin/php -q
and in the file (/home/kurs/etc/cron.php) these:
#!/usr/bin/php
I am very sad because that. Please help me, if you know.
Thank you!

Walter
 
Top