php - phpmailer with hotmail? -


I am trying to send email from PHP server. I wanted to send it to the original php function by mail and everything worked fine. Here's the code I used:

  $ to $ $ s mail; & Lt; Br> $ Theme = $ sSubject; & Lt; Br> $ Message = $ s message; $ Header = 'from: user@domain.com' "\ r \ n"; & Lt; Br> $ Headers = 'Reply: user@domain.com' "\ r \ n"; & Lt; Br> $ Headers = 'MIME-version: 1.0' "\ r \ n"; & Lt; Br> $ Headers = 'Content-type: text / html; Charset = UTF-8 '"\ r \ n"; & Lt; Br> $ Brs = mail ($ to $ $ theme, $ message, $ headers);  

I then switched to PHPMailer, and was not able to send mails to Hotmail accounts (all the others still working). Hotmail reports a server error: "550 SC-2001 has been rejected by Windows Live Hotmail for the reasons for the mail policy."

This is the code I used for PHPMailer:

  $ mail = new PHPMailer (); & Lt; Br> $ Mail & gt; IsHTML (true); & Lt; Br> $ Mail- & gt; Charset = 'utf-8'; & Lt; Br> $ Mail- & gt; = 'User@domain.com' from '; & Lt; Br> $ Mail-> name = 'domain.com'; & Lt; Br> $ Mail- & gt; Subject = $ sSubject ;; & Lt; Br> $ Mail- & gt; Body = $ sMessage; & Lt; Br> $ Mail- & gt; AltBody = strip_tags ($ sMessage;); & Lt; Br> $ Mail & gt; AddAddress ($ Smail); & Lt; Br> $ Mail & gt; Send (); & Lt; Br> $ Mail & gt; ClearAddresses (); & Lt; Br> $ Mail & gt; ClearAttachments ();  

Works with native functions as sending, I'm sure my server is capable of sending mail to Hotmail. While using PHPMailer there should be a property to set up, but I do not think right.

Try removing line $ mail-> from name = 'domain.com';


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -