Solved

Using PHP and PEAR Mail for Bounce-Catching

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Read about why website design really matters in today's demanding market.
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn how to dynamically set the form action using jQuery.

930 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now