Solved

Using PHP and PEAR Mail for Bounce-Catching

Posted on 2009-04-06
4
909 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 500 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 500 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

821 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