?
Solved

Using PHP and PEAR Mail for Bounce-Catching

Posted on 2009-04-06
4
Medium Priority
?
940 Views
Last Modified: 2013-11-10
I have a PHP script that runs when emails are sent to bounce@... I've read many solutions on EE and articles on the web, but what's the best way to handle bounces with PHP and PEAR mail? I've read that return-path isn't an SMTP standard... what should I do?
0
Comment
Question by:EMB01
  • 2
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
vdelau earned 2000 total points
ID: 24080808
http://pear.php.net/manual/en/package.networking.net-smtp.net-smtp.mailfrom.php

This allows you to set the MAIL FROM name that is send in the SMTP conversation.

<?php
 
$mailer = Mail::factory('smtp',$params);
$mailer->getSMTPObject()->mailFrom('bounce@...');

Open in new window

0
 
LVL 14

Author Comment

by:EMB01
ID: 24081031
Okay, that looks promising. How can I pass a user variable such as and ID through an email. I've read you can create a catch-all address so I could do:
$bounce = $id . "-bounce@...";

However, I'm on Plesk so I don't think I can create a catch-all... Are there any other ways to return an ID variable to my bounce script.
0
 
LVL 4

Assisted Solution

by:vdelau
vdelau earned 2000 total points
ID: 24085364
On Plesk you can create a catch-all adress. On your domains page, go to mail and then to preferences.and choose what to do with mail to nonexistent user. You can first create a mailbox and forward all mail to there.

You could then indeed create a per user bounce adres. You can also encode the users email adres and add that to the bounce adres (bounce-user=example.org@...)
0
 
LVL 14

Author Closing Comment

by:EMB01
ID: 31566979
Thanks for your help. I'm now developing this...
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question