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.

Possible to send a preset email on failure?

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

  1. Phree

    Phree Member

    Joined:
    Nov 17, 2005
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    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.
     
Loading...

Share This Page