0

Hi i am sending the mail through the libmail, downloaded from http://www.phpclasses.org . Mail Function is working fime but it does not deliver the bounced message delivered report in the return path mail ID inbox and also i am face the problem in how to check if the mail is delivered are not. i already read this file:///C:/Program%20Files/xampp/htdocs/libmail2/libmail_en.html#Send%28%29 tutorial with the zipped file they are not clearly mention the send function process. i am new to the oops function i just change the function like this

public function Send () {
        $this->BuildMail ();
        $strTo = implode (", ", $this->sendto);

    if(!mail ($strTo, $this->xheaders['Subject'], $this->fullBody, $this->headers))
    {
    print_r("Unable To Send At This Time Please Try Again Later");
    $strTo = "**@gmail.com";
    $this->Subject("Could Not Delivery The Mail At This Time . Please Try Again Later");
    //xheaders['Subject'] = "Mail Sending Failed";
    //mail ($strTo, $this->xheaders['Subject'], $this->fullBody, $this->headers);
    return mail ($strTo, $this->xheaders['Subject'], $this->fullBody, $this->headers);
    }
    else
    {
    print_r("Message Send Successfully");
    //return mail ($strTo, $this->xheaders['Subject'], $this->fullBody, $this->headers);
    }
    //
} . If any Body already experienced with the libmail functionality please guide me. Thanks in advance.
Meena
  • 957
  • 5
  • 19
  • 35

2 Answers2

0

Bounceback E-Mails arrive after the sending process. They are not within the scope of any PHP mail sending function.

What one would usually do is to watch the specified mailbox for any "undeliverable" messages after sending. This process can be automated but it's very cumbersome.

Pekka
  • 442,112
  • 142
  • 972
  • 1,088
  • @Meena so what is your question then? Not sure I understand – Pekka Oct 15 '10 at 10:49
  • mail ($strTo, $this->xheaders['Subject'], $this->fullBody, $this->headers) function returns some value deponds upon the mail send or not. My problem is the mail function does not check whether the e-mail is correct or Not even if send the mail to wrong email address it return true.i think so only it does not deliver the bounced back email to return path. – Meena Oct 15 '10 at 11:00
  • @Meena yes, that is because the mail() function passes the message on to the system's mail server which will then determine how to send it. Nothing you can do really except check the mail address for validity beforehand, or read through the bouncebacks – Pekka Oct 15 '10 at 11:05
  • ok Sorry Is there is any function is available to check whether the email is valid or not. Bcoz i am trying this in past 1 week still i did notsolve this issue – Meena Oct 15 '10 at 11:14
  • 1
    @Meena sure. See http://stackoverflow.com/questions/201323/what-is-the-best-regular-expression-for-validating-email-addresses – Pekka Oct 15 '10 at 13:29
  • Thank you so much Pekka . That link is very useful for me – Meena Oct 19 '10 at 05:41
0

You can set the Return-Path header to define where bounce messages will be send when delivery fails. You can set the return path address to associated to a POP3 mailbox. You can check that mailbox regularly with a POP3 client class. Parsing the bounce messages you can figure what email address is bouncing. You can use a MIME parser class to parse messages and extract the addresses for you.

Flexo
  • 87,323
  • 22
  • 191
  • 272
mlemos
  • 1,235
  • 13
  • 21