title: php mail function not working reply SMTP server response: 503
body: <p>I try to send mail using php mail function. but I getting error like:</p>
  
  <pre><code>PHP Warning:  mail(): SMTP server response: 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server. in C:\Inetpub\vhosts\qubedns.co.in\httpdocs\Codes\design\rnp\mailsend.php on line 21
  </code></pre>
  
  <p>Here is my PHP SCRIPT:</p>
  
  <pre><code>&lt;?php
  
  $toEmail    = 'bikash336@gmail.com';
  $subject    = 'hello';
  $message    = 'Users are able to send emails to local domains and addresses but are unable to send email to any external address.';
  $headers    = "MIME-Version: 1.0" . "\r\n";
  $headers    .= "Content-type:text/html;charset=UTF-8" . "\r\n";
  $headers    .= 'From: &lt;sales@leonwallet.com&gt;' . "\r\n";
  
  $Status = mail($toEmail,$subject,$message,$headers);
  
  if($Status){
      echo '1';
  }else{
      echo '0';
  }
  
  ?&gt;
  </code></pre>
  
  <p>Here is my Server configuration: <a href="http://qubedns.co.in/codes/php/" rel="nofollow">http://qubedns.co.in/codes/php/</a></p>
  
  <p>What's wrong with me?</p>