0

I am using php mail() function to send emails. But it is not able to send mails to certain domain. For example it goes to email ids with @gmail.com but it is not going to emails @eduraft.com Hers is the code which I have used. ( I am using wordpress and I am facing the same problem with wp_mail).

$to      = 'abc@eduraft.com';
$subject = 'Admission Alert';
$message = 'Admission Alert';
$headers = 'From: xyz@eduraft.com' . "\r\n" .
'Reply-To: xyz@eduraft.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers); 

even i used "-fxyz@eduraft.com" but it is not working. Whereas if I send the mail to abc@gmail.com it works.

Michael Berkowski
  • 267,341
  • 46
  • 444
  • 390
  • If the problem is domain specific, then, I would suggest that a spam filter is eating your mails, rather than it not sending them. – BugFinder Jun 19 '12 at 11:25
  • And sending an email to abc@eduraft.com works from your normal email client? Are you sure that the @eduraft.com accounts aren't marking your PHP mail as spam/junk? – WhoaItsAFactorial Jun 19 '12 at 11:25
  • 1
    Are you trying to send *to* `eduraft.com` or *from* `eduraft.com`? It sounds like you are setting the *envelope* sender to something other than the envelope sender -- you don't want to do that. – David Schwartz Jun 19 '12 at 11:25
  • You are sending from the same domain as the receiver...this is by design. – Vincent Ramdhanie Jun 19 '12 at 11:25
  • Are you using any sort of spamfilter under your SMTP? – AleksanderKseniya Jun 19 '12 at 11:26
  • "Doesn't work" as in "the email isn't sent" or "I get an error message" or "the recipient doesn't get the message" or "message blocked by spam filter" or what? As much detail as possible, if for no other reason - to show that you've tried to debug the issue. – Wesley Murch Jun 19 '12 at 11:27
  • I checked spam. It is not going to spam. And it is not only with eduraft even i did with another domain ab@feedinfra.com it is not going. But it goes to xyz@aavishkaar.in – Thirukumaran Nagarajan Jun 19 '12 at 11:32
  • Is it an *nix server? If so, could you post the sendmail related log? – AleksanderKseniya Jun 19 '12 at 11:39
  • `qmail: 1340096071.050096 end msg 556080 Jun 19 12:54:31 CentOS-57-32-minimal qmail: 1340096071.051289 delivery 655: success: did_0+0+1/ Jun 19 12:54:31 CentOS-57-32-minimal qmail: 1340096071.051313 status: local 0/10 remote 0/60 Jun 19 12:59:13 CentOS-57-32-minimal qmail: 1340096353.817213 new msg 524548 Jun 19 12:59:13 CentOS-57-32-minimal qmail: 1340096353.821879 info msg 524548: bytes 519 from qp 413 uid 48 Jun 19 12:59:13 CentOS-57-32-minimal qmail: 1340096353.825485 starting delivery 656: msg 524548 to local eduraft.com-thiru@eduraft.com` – Thirukumaran Nagarajan Jun 19 '12 at 12:00
  • See http://stackoverflow.com/questions/1107730/php-cant-send-email-to-addresses-at-my-own-domain – Vincent Ramdhanie Jun 19 '12 at 15:35

0 Answers0