+ Reply to Thread
Results 1 to 9 of 9

Thread: Getting server to send mail

  1. #1
    dmoneyman is offline x10Hosting Member dmoneyman is an unknown quantity at this point
    Join Date
    Mar 2009
    Posts
    19

    Getting server to send mail

    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?

  2. #2
    lemon-tree's Avatar
    lemon-tree is offline x10 Minion lemon-tree has a spectacular aura about
    Join Date
    Nov 2007
    Posts
    1,420

    Re: Getting server to send mail

    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

  3. #3
    dmoneyman is offline x10Hosting Member dmoneyman is an unknown quantity at this point
    Join Date
    Mar 2009
    Posts
    19

    Re: Getting server to send mail

    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?

  4. #4
    lemon-tree's Avatar
    lemon-tree is offline x10 Minion lemon-tree has a spectacular aura about
    Join Date
    Nov 2007
    Posts
    1,420

    Re: Getting server to send mail

    What are you trying to send and from where?

  5. #5
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: Getting server to send mail

    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.
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  6. #6
    dmoneyman is offline x10Hosting Member dmoneyman is an unknown quantity at this point
    Join Date
    Mar 2009
    Posts
    19

    Re: Getting server to send mail

    Quote Originally Posted by lemon-tree View Post
    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.

  7. #7
    Chris Z's Avatar
    Chris Z is offline x10 Spammer Chris Z is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Alabama, USA
    Posts
    2,802

    Re: Getting server to send mail

    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,
    -Chris Z
    Retired Account Manager


  8. #8
    lemon-tree's Avatar
    lemon-tree is offline x10 Minion lemon-tree has a spectacular aura about
    Join Date
    Nov 2007
    Posts
    1,420

    Re: Getting server to send mail

    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

  9. #9
    kursnalista is offline x10Hosting Member kursnalista is an unknown quantity at this point
    Join Date
    Apr 2009
    Posts
    4

    Re: Getting server to send mail

    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

+ Reply to Thread

Similar Threads

  1. using mail server
    By yudik in forum Scripts & 3rd Party Apps
    Replies: 3
    Last Post: 02-24-2010, 07:51 PM
  2. Replies: 1
    Last Post: 10-21-2007, 12:42 AM
  3. Mail Server problem
    By deathwish2005 in forum Free Hosting
    Replies: 1
    Last Post: 09-06-2005, 12:23 PM
  4. Need help please with SMTP outgoing mail server
    By flyingwolf in forum Free Hosting
    Replies: 15
    Last Post: 06-02-2005, 05:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers