title: PHPMailer Send an email through a Local Domain but from a regular Email
body: <p>I am trying to setup PHPMailer for a customer. He has his own mail server located at a certain IP address. When asked to give me the information to send email through the system, he gave the following:</p>
  
  <pre><code>Host: xx.xxx.x.x
  Port: 25
  Domain: mydomain.local
  Username: myemail@mydomain.local
  Password: &lt;myemailpassword&gt;
  From: myemail@anotherdomain.xx
  </code></pre>
  
  <p>(Which he confirmed is being used for external email sending)</p>
  
  <p>I tried to setup PHPMailer by setting the parameters to the exact namings above.</p>
  
  <pre><code>$mail-&gt;IsSMTP();                      
  $mail-&gt;SMTPDebug  = 1;                
  $mail-&gt;SMTPAuth   = true;            
  $mail-&gt;SMTPSecure = "ssl";          
  $mail-&gt;Host       = "xx.xxx.x.x";
  $mail-&gt;Port       = 25;              
  $mail-&gt;Username   = "myemail@mydomain.local";  
  $mail-&gt;Password   = &lt;myemailpassword&gt;;         
  
  $mail-&gt;SetFrom('myemail@anotherdomain.xx', 'Webname');
  $mail-&gt;[...]
  </code></pre>
  
  <p>I got the following error:</p>
  
  <pre><code>Failed to connect to server (0)
  </code></pre>
  
  <p>So I try to send an email through <code>telnet</code> to check if it's the customer's email server or the PHPMailer settings:</p>
  
  <pre><code> telnet xx.xxx.x.x 25
  </code></pre>
  
  <p>It goes through, I'm connected to the server.</p>
  
  <pre><code> helo mydomain.local
  </code></pre>
  
  <p>I'm getting 'Hello' as a reply. This leads me to believe it might be the PHPMailer settings that are wrong here.</p>
  
  <p>I also try not using SMTP:</p>
  
  <pre><code>$mail-&gt;Host       = "ssl://xx.xxx.x.x";
  $mail-&gt;Port       = 25;              
  $mail-&gt;Username   = "myemail@mydomain.local";  
  $mail-&gt;Password   = "password";         
  
  $mail-&gt;SetFrom('myemail@anotherdomain.xx', 'Webname');
  $mail-&gt;[...]
  </code></pre>
  
  <p>Again no go. Am I going about this wrong? I'm only familiar with setting up PHPMailer to use Gmail before so I'm at a loss as to what could be the issue because I'm using a 'personal' email server.</p>