Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Possible to send a preset email on failure?

Discussion in 'E-mail Discussion' started by Phree, Nov 30, 2005.

  1. Phree

    Phree Member

    Nov 17, 2005
    Likes Received:
    Trophy Points:
    South Coast of England
    Hi all,

    I have searched to see if this has been posted before, but I haven't managed to find anything. I'm wondering if it's possible to create a preset error email on a certain mail account?

    Basically, I have a website where users can post images using their mobile phones. It is also possible to email the site with an attached image. Basically, I have a forwarder that takes the emails sent and it sends to a specific account. Each user has a unique email address to send to so the script I have running knows which userid to post the pictures under. However, sometimes the user will put the wrong email address and they receive the "Mail delivery failed: returning message to sender" email. That email contains a little too much information for my liking - it lists script names etc., and I would rather it just said something along the lines of, "Your email couldn't be delivered to the site. Please contact Phree directly to help you solve this issue."

    Is this possible does anyone know?

    As always guys, thanks for any help :)
  2. webignition

    webignition Well-Known Member

    Jan 22, 2005
    Likes Received:
    Trophy Points:
    If this is the case, it sounds very much like the emails are being piped to a script which then parses the email and extracts the relevant data?

    I do a fair amount of piping mail to PHP scripts and find that, when developing scripts, if the PHP script fails to execute properly, the sender receives a delivery message containing the PHP errors and related information. Useful when developing, rather poor in production!

    However, the point being that if users are receiving emails containing script names and so forth, it sounds like emails are being piped to a script which is then failing to execute correctly.

    If this is really the case, the only sensible solution you have is to debug the script and find out why it is generating errors under certain conditions and both resolve these runtime bugs and add the relevant functionality to the script so that it returns meaningful error messages to users.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice