Solved

Using PHP and PEAR Mail for Bounce-Catching

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
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…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

757 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

19 Experts available now in Live!

Get 1:1 Help Now