-5

I am using zend framework and i write the following code for sending a mail from another sever.Bu t dont know why it throws the following exception.

5.7.1 This email has been blocked. The email message appeared to contain a data leak

I am using the following code

public function sendMail($a_Subject,$a_Message,$a_toMail,$a_toName,$a_frmMail,$a_frmName){

    $theConfig  =   array('auth' => 'login',
                    'username' => 'someusername.ocm',
                    'password' => 'somepass');
    $objTranpt  =   new Zend_Mail_Transport_Smtp('somehost.net', $theConfig);
    $mailObj    =   new Zend_Mail();

    $mailObj->setBodyHtml($a_Message);
    $mailObj->setFrom($a_frmMail, $a_frmName);
    $mailObj->addTo($a_toMail,$a_toName);
    $mailObj->setSubject($a_Subject);
    $mailObj->send($objTranpt);

    return true;
}

And when i try to send mail i got thw following error on my try catch..How to rersolve this??Thanks for the help in advance...

Frank Thomas
  • 37,476

1 Answers1

3

A 5.7.1 message indicates that a SMTP relay server can't or won't forward your traffic. the most common cause is bad authentication (are your username and password right?). unfourtunately, the other causes for this error are numerous and almost all are on the server end (relaying disabled globally, relaying not permitted for specific user, relaying from sending network not permitted, etc).

The folks from Mozilla explain it pretty well: http://kb.mozillazine.org/5.7.1_Unable_to_relay

in your case, simply based on the message it looks like your SMTP server is employing some form of leak protection software that is blanket denying SMTP relaying, assuming that it is someone trying to get around other established policies/protections. That you got a 5.7.1 at all means that your code was fine (other than perhaps authentication), and the issue is server configuration.

Frank Thomas
  • 37,476