0

Basically I realized that if my send-to address has numbers on it, the mail isn't sent!

Here's the example code:

$server = 'info@mywebsitehas3number.com';
$from = $contact_name;
$body = '
    <html>
    <head>              
    </head>
    <body>
        blablablabla
    </body>
    </html>
';
$headers = "From: " .$contact_name. " <" .$contact_email. ">" . "\r\n" . "Reply-To: " .$contact_email. "\r\n";
$headers .= "Content-Type: text/html; charset=utf-8";
$headers .= "<meta charset='utf-8' />";
mail($server, $contact_subject, $body, $headers);

As you can see, my server address has a number on it, well, because basically my website address contains a number. When sending, the inbox won't receive anything. If I send it to my personal e-mail which has no number, I'll receive it.

I even have another gmail account with a number on the address, e.g. (address4@gmail.com) and it also doesn't work!

How can I make this work?

Thanks

coldpumpkin
  • 711
  • 4
  • 14
  • 30
  • odd - whats the mail server log say? –  May 17 '15 at 23:05
  • While this has seldomly anything to do with PHP or the mail() function, the stray HTML meta tag in the `$headers` probably doesn't help. – mario May 17 '15 at 23:15
  • @Dagon I don't have a log though I added a `$emailSent = true;` so that I can receive a message if it's sent and it's sending. – coldpumpkin May 17 '15 at 23:24
  • @mario I removed that part from the header and still nothing. Went through the things from the other post you suggested as duplicate, but no dice. Thing is - it's working with all mails without a number. If I introduce a email address with a number, it doesn't send anything. – coldpumpkin May 17 '15 at 23:24
  • While this may be an interesting variation, this question remains entirely unanswerable still. The described behaviour can't be caused by mail(). Only the mail server, its entire configuration, logs, etc. are relevant. (Which would be entirely too broad, even if you could provide those.) – mario May 17 '15 at 23:52

0 Answers0