Solved

Using PHP and PEAR Mail for Bounce-Catching

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

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…
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

816 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

8 Experts available now in Live!

Get 1:1 Help Now