njjacob Posted May 16, 2007 Share Posted May 16, 2007 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('njacob@camdendiocese.org', '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. Quote Link to comment https://forums.phpfreaks.com/topic/51671-server-keeps-blocking-the-email/ Share on other sites More sharing options...
taith Posted May 16, 2007 Share Posted May 16, 2007 call that email provider, tell them to unblock your email servers... (make sure you have your servers ip address first) Quote Link to comment https://forums.phpfreaks.com/topic/51671-server-keeps-blocking-the-email/#findComment-254523 Share on other sites More sharing options...
lee20 Posted May 16, 2007 Share Posted May 16, 2007 It appears you are using PHPMailer and if so try: $mailer->Sender = 'valid@email.com'; 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 valid@email.com"); 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 webmaster@yoursite.com -f webmaster@yoursite.com" Hope this helps. Cheers! Quote Link to comment https://forums.phpfreaks.com/topic/51671-server-keeps-blocking-the-email/#findComment-254590 Share on other sites More sharing options...
njjacob Posted May 16, 2007 Author Share Posted May 16, 2007 ??? can you tell me where exactly you are putting the extra parameter at? Quote Link to comment https://forums.phpfreaks.com/topic/51671-server-keeps-blocking-the-email/#findComment-254602 Share on other sites More sharing options...
njjacob Posted May 16, 2007 Author Share Posted May 16, 2007 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 webmaster@camdendiocese.org");"; cn you tell me the right way to word it? Quote Link to comment https://forums.phpfreaks.com/topic/51671-server-keeps-blocking-the-email/#findComment-254607 Share on other sites More sharing options...
njjacob Posted May 16, 2007 Author Share Posted May 16, 2007 one other thing-we use a exchange server here.. would that matter? Quote Link to comment https://forums.phpfreaks.com/topic/51671-server-keeps-blocking-the-email/#findComment-254614 Share on other sites More sharing options...
lee20 Posted May 16, 2007 Share Posted May 16, 2007 You don't need to edit the class. Just add: $mailer->Sender = 'valid@email.com'; Quote Link to comment https://forums.phpfreaks.com/topic/51671-server-keeps-blocking-the-email/#findComment-254688 Share on other sites More sharing options...
njjacob Posted May 16, 2007 Author Share Posted May 16, 2007 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 = 'valid@email.com'; 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! Quote Link to comment https://forums.phpfreaks.com/topic/51671-server-keeps-blocking-the-email/#findComment-254705 Share on other sites More sharing options...
lee20 Posted May 16, 2007 Share Posted May 16, 2007 Revert any changes you made to class.phpmailer.php! In your script where you are sending the email change it to look like this: // Add an address to send to. $mailer->AddAddress('njacob@camdendiocese.org', 'Eric Rosebrock'); $mailer->Sender('njacob@camdendiocese.org'); Quote Link to comment https://forums.phpfreaks.com/topic/51671-server-keeps-blocking-the-email/#findComment-254750 Share on other sites More sharing options...
njjacob Posted May 16, 2007 Author Share Posted May 16, 2007 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('njacob@camdendiocese.org', 'Eric Rosebrock'); $mailer->Sender('njacob@camdendiocese.org'); <----line 20 now what... I have about 5 people working on this. and we are all confused. this is supposed to be simple. Quote Link to comment https://forums.phpfreaks.com/topic/51671-server-keeps-blocking-the-email/#findComment-254758 Share on other sites More sharing options...
cooldude832 Posted May 16, 2007 Share Posted May 16, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/51671-server-keeps-blocking-the-email/#findComment-254759 Share on other sites More sharing options...
njjacob Posted May 16, 2007 Author Share Posted May 16, 2007 you have been so nice to me for even answering.. thank you. I give up for now and I'll let IT work on it. Nikki Quote Link to comment https://forums.phpfreaks.com/topic/51671-server-keeps-blocking-the-email/#findComment-254761 Share on other sites More sharing options...
lee20 Posted May 16, 2007 Share Posted May 16, 2007 My bad should be: $mailer->AddAddress('njacob@camdendiocese.org', 'Eric Rosebrock'); $mailer->Sender = 'njacob@camdendiocese.org'; Quote Link to comment https://forums.phpfreaks.com/topic/51671-server-keeps-blocking-the-email/#findComment-254809 Share on other sites More sharing options...
njjacob Posted May 18, 2007 Author Share Posted May 18, 2007 hey thanks again-the form worked but it didnt go through to my email again. darn it. what are referrers? would they do anything? Quote Link to comment https://forums.phpfreaks.com/topic/51671-server-keeps-blocking-the-email/#findComment-256260 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.