The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

sh: -t: command not found when sending email

Discussion in 'E-mail Discussions' started by s_2_s, Nov 4, 2007.

  1. s_2_s

    s_2_s Well-Known Member

    Joined:
    Aug 9, 2004
    Messages:
    215
    Likes Received:
    0
    Trophy Points:
    16
    Hello
    i face the error
    sh: -t: command not found

    while i make a simple php script which only have mail function and excute this script from shell
    by example

    mail.php

    <?
    mail("sales@xxxxxxxxxx.com", "My Subject", "Line 1\nLine 2\nLine 3");

    ?>

    then from shell as root

    php mail.php

    i get
    sh: -t: command not found

    please advise
     
  2. sarhosting

    sarhosting Well-Known Member

    Joined:
    Oct 1, 2007
    Messages:
    164
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    United States
    cPanel Access Level:
    Root Administrator
    Twitter:
    2 options

    1) - Open a ticket with cPanel
    2) Speak to your datacentre
     
  3. s_2_s

    s_2_s Well-Known Member

    Joined:
    Aug 9, 2004
    Messages:
    215
    Likes Received:
    0
    Trophy Points:
    16
    anybody have an idea about why could this be happening ?
     
  4. DaveUsedToWorkHere

    DaveUsedToWorkHere Well-Known Member

    Joined:
    Dec 28, 2001
    Messages:
    689
    Likes Received:
    1
    Trophy Points:
    18
    This is likely related to a local configuration on the server. Using the mail function as you described should work fine.

    Since the error is related to sh, it looks like something might be up on the system. Try running the following to make sure that php is available and you are using the right path.

    Code:
    which php
    It can't hurt to force the script to use the above output iwht a shebang line like: #!/usr/local/bin/php

    This is more of a php related question though and I'd try to head in that direction. You might want to look into some php tutorials on error handling.
     
Loading...

Share This Page