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.

Sending email to a Script using CPanel

Discussion in 'E-mail Discussions' started by uamistad, Jan 28, 2005.

  1. uamistad

    uamistad Registered

    Joined:
    Jan 25, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Greetings to all of you, men !!

    I have seen that you know something about this.

    Look, I want to redirect all the mail that anyone send to myemail@mydomain.com to a PHP Script.

    In the DESTINATION field (in CPANEL9 --> E-mail Filtering), I have tried all of this and a lot more:
    Where "mbcomp" is my user name.

    I have my Script in: /public_html/display.php

    The code in the file display.php is this:

    PHP:
    PHP Code:
    #!/usr/bin/php -q
    <?php
    mail
    ("mymail@mydomain.com","IT'S DONE, WOW!!","YES, THIS TEST IS WORKING");
    ?>
    That, in order to get an email to my personal address just for a TEST. If I go directly to http://www.mydomain.com/display.php it works, cos I receive that email.

    But I have not received any mail with the subject "IT'S DONE, WOW" when I send an email to mymail@mydomain.com.

    I only have received mails that say "MAIL DELIVERY FAIL" in the subject.

    I wonder if you could mind helping me with any advise you can. Anything will help. It's very important to me.

    Thank you, man !!
     
  2. weaver

    weaver Active Member

    Joined:
    Jan 19, 2005
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    You should be in: Forwarders NOT E-mail Filtering ;)


    1.) Click Forwarders
    2.) Click Add Forwarder "Link"
    3.) Enter e-mail alias in first field
    4.) Select domain or sub domain in second field
    5.) Enter |/home/mbcomp/public_html/display.php in third field
    6.) Click Add Forwarder "Button"
    7.) Do your test again!

    Hope this helped?
     
  3. uamistad

    uamistad Registered

    Joined:
    Jan 25, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I can't do it

    Hi !!

    I followed your steps, but I already receive just the "Error message", I mean, the PHP Script is not running yet.

    Could you tell me what's your Hosting name, please?

    Maybe is my hosting. It could be find to try another.
     
Loading...

Share This Page