Jump to content

SERVER KEEPS BLOCKING THE EMAIL


njjacob

Recommended Posts

Help! I have been trying for weeks and am stumped. Our servers keep blocking the email sent from anything I create. I am doing the test only so far. and when I make the TO

 

// Add an address to send to.

$mailer->AddAddress('[email protected]', 'Eric Rosebrock');

 

the camdendiocese.org servers keep blocking the email. Any suggestions on how to get around this? When I change it to my home address; a hotmail account. The whole thing works great.

Link to comment
https://forums.phpfreaks.com/topic/51671-server-keeps-blocking-the-email/
Share on other sites

It appears you are using PHPMailer and if so try:

$mailer->Sender = '[email protected]';

 

I encountered a similar type of issue, and I'm not sure if the problem your having is the same as mine but I will post the solution that I found as well.

 

I was using a basic implementation of PHP's mail function and wasn't receiving the emails that were being sent. The logs from my incoming mail server told me that the emails had been rejected because it couldn't check the return path (some mail servers do this to block spam).

 

I had to set an extra parameter like so:

mail($to, $subject, $body, $headers, " -f [email protected]");

 

This from PHPMailer's documentation:

$Sender

    PHPMailer::$Sender in class.phpmailer.php

    Sets the Sender email (Return-Path) of the message. If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.

 

 

$Sender

    PHPMailer::$Sender in class.phpmailer.php

    Sets the Sender email (Return-Path) of the message. If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.

 

 

This from http://www.php.net/function.mail

 

If you're using a linux server using Postfix, and your server hasn't the host name set to a valid name (because it's behind a firewall in an intranet), it's possible that when sending mails using the mail function, some mail servers reject them. This is because they can't check the return path header. If you want to change the Return-Path used by sendmail init the php.ini and edit the sendmail_path variable to this:

 

sendmail_path = "sendmail -t -i -F [email protected] -f [email protected]"

 

Hope this helps.

 

Cheers!

I did this and it is wrong:

 

  /**

    * Sets the Sender email (Return-Path) of the message.  If not empty,

    * will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.

    * @var string

    */

    var $Sender            = "mail($to, $subject, $body, $headers, " -f [email protected]");";

 

cn you tell me the right way to word it?

in class.phpmailer.php?  because i did this:

 

/**

    * Sets the Sender email (Return-Path) of the message.  If not empty,

    * will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.

    * @var string

    */

    var $Sender            = "";

$mailer->Sender = '[email protected]';

 

and i got this:

Parse error: syntax error, unexpected T_VARIABLE, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/camdendi/public_html/lib/phpmailer/class.phpmailer.php on line 75

 

 

OHH GOSH this is so confusing!

Its says

 

Fatal error: Call to undefined method: freakmailer->sender() in /home/camdendi/public_html/mailtest.php on line 20

 

line 20 is

 

// Add an address to send to.

$mailer->AddAddress('[email protected]', 'Eric Rosebrock');

$mailer->Sender('[email protected]');      <----line 20

 

now what... I have about 5 people working on this. and we are all confused. this is supposed to be simple.

fyi many servers are creating an auto blacklist policy like aol (oh aol ;)) and you must pay to get removed off blacklisted onto whitelist and then there are fees per email beyond that so its a coming age when we will have to start doing route arounds with php and maybe ajax

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.