Jump to content

checking bounces from mail() function


PeggyBuckham

Recommended Posts

I have a form where the user puts in a email address. My client whats to make sure that the emails are valid emails. So after validating the format and the domain. I will send a email to the user. I want to check to see if this email bounces or not. I think that if I add

 

$headers .= "Return-Path: me@example.com\r\n";

 

to the header of the email then if it bounces  an email will be sent to me@example.com. There could end up being at least 50 bounces.  Is this the correct way to do this?? I have never used a Return-Path in the $headers before. It would be nice if I could put the email address that bounce into the database that the infor collected from the form goes.

Link to comment
Share on other sites

I'm hoping someone has an answer for me becouse this is not working...yet...

All I really need is to be able to get the emails that bounce to go to a specific email address.

I would appreciate any help I can get. Thanks

Here is my code:

 

<?php

$to = $email;

$subject = "Confirmation Email";

$headers  = 'MIME-Version: 1.0' . "\r\n";

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

$headers .= 'From:noreply@example.com'. "\r\n";

$headers .= 'Return-Path: peggy@example.com'. "\r\n";

 

$return_path = 'peggy@example.com';

$message ='<html>

<head>

</head>

<body>

<table>

<tr>

<td>

<p>my text</p>

<img src="http://www.example.com/enews/images/photo.jpg" width="600" height="437" />

</body>

</html>';

mail($to, $subject, $message, $headers, '-f ' . $return_path);

?>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.