Use SMTP Auth, then Hotmail will no longer complain. Anonymous emails are considered spam on almost all receiving servers.
$mail->SMTPAuth = true; // enable SMTP authentication $mail->Host = "mail.yourdomain.com"; // sets the SMTP server $mail->Port = 26; // set the SMTP port $mail->Username = "yourname@yourdomain"; // SMTP account username $mail->Password = "yourpassword"; // SMTP account password
But ofc. depending on whether you have control over your SMTP or not, you need to make sure that basic elements such as reverse-dns-lookup are configured correctly
Due to the discussion in the comments, I want to add a little more information about my thinking about why SMTP Auth will fix this:
IF you use PHPMailer without defining an SMTP server, PHPMailer will operate in mail mode, which simply calls the mail() php function.
The mail function itself will use the smtp parameters configured in the PHP-INI file, or the default values โโthat are listed here: http://php.net/manual/en/mail.configuration.php
default:
SMTP = "localhost" smtp_port = "25"
Since the OP has configured a local mail server (or why did it set MX records?), Php will now connect to this SMTP server without authentication. The server will accept the message and send it to the next server.
(The same applies if unix 'sendmail is used)
Each server in the chain and especially on the receiving server can now see that private SMTP is being used and authentication is not provided. This is already a Spam-Score of more than 9000, because with this setting (theoretically) everyone can use this server to send letters! Limitations, as only from localhost, are cc. unknown to other servers, so SMTP is considered Email Relay http://en.wikipedia.org/wiki/Open_mail_relay
Switching PHPMailer to SMTP-Auth (EVEN if using a local SMTP server) will add this information to the record created by the server when forwarding mail. The entry will look like this:
Received: from SERVER1 ([xxx.xxx.xxx.xx]) by mydomain.de with ESMTPA
Finishing A after ESMTPA now tells the receiving server that Server1 used a valid user account on mydomain.de to start sending, which means that the SMTP server knows the origin of the mail and can provide information about the sender.
However, the local SMTP server is not known, so in this case it may appear as greylisted and checked on different RBLs, which should not be a problem in this case.
If the (local) SMTP server now passes ALL checks (reverse DNS lookup, Greylisting, RBL, and what not) - mail has a good chance of successful delivery, even if the remote smtp is not used, since the server can be authenticated successfully, as well sender using this server. (Otherwise, no company could set up their own servers)
Thus, using SMTP-Auth (or any other authentication method) will also have an effect, even if you are not using a remote SMTP server.
Authenticated emails are not a guarantee that they are not considered spam, but unauthenticated emails are definitely ranked in the Spam-Score of common systems.