title: phpmailer SMTP with STARTTLS encryption
body: <p>would anyone know if it is possible to run <strong><em>phpmailer with STARTTLS encryption</em></strong>?</p>
  
  <p>The story: an online order form that sends the output to both the site visitor and site owner. The goal is that the visitor receives an email from <strong><em>orders@ownerdomain.com</em></strong>, while the site owner receives an email from <strong><em>visitor@somedomain.com</em></strong> (the address that the visitor has filled i the online form).</p>
  
  <p>I have the phpmailer running fine with my Gmail account, using TLS on port 587. I would, however, like to use mailbox provided along with the hosting (so that the from/replyTo looks professional, no freemail). Unfortunately, the hosting provider does not provide TLS - in their knowledgebase they only mention STARTTLS. I tried all combinations of SSL, TLS and STARTTLS for encryption and 465 and 587 for ports with no success.</p>
  
  <p>Would anyone know if STARTTLS is somehow achievable, please?</p>
  
  <hr>
  
  <p>My plan B would was to use the Gmail SMTP credentials and then tinker with <strong><em>addReplyTo</em></strong>, <strong><em>setFrom</em></strong> and <strong><em>addAddress</em></strong> in the phpmailer SMTP settings. I tried but if I use...</p>
  
  <pre><code>$mail-&gt;addReplyTo($_POST['customeremail'], $_POST['customername']);
  </code></pre>
  
  <p>...the <strong><em>from</em></strong> email address the site owner receives is that of my Google email - I understand this may be some Google email spoofing protection, which just doesn`t allow the SMTP to send an email with the <strong><em>From address</em></strong> taken from the form. - please see the attached ![Thunderbird screen( image: imgur.com/a/1f6vY).  </p>
  
  <p>Can this be possibly overridden?   </p>
  
  <p>I mean, with that plan B solution, I can grant Google access to send emails on behalf of <code>orders@ownerdomain.com</code>, that`s all fine, it will then mimick the professional domain address. But I cannot do the same for the visitor address (taken from the form), that makes sense, right?</p>
  
  <p>Thanks a bunch in advance...  </p>