title: Sending Email using godaddy smtp relay and PHPMailer on codeigniter
body: <p>I am trying to reset password mails to client users. I am using a helper function which is called from the controller to send emails.</p>
  
  <pre><code>function submit_email($to,$subject,$message)
  {
      $CI = get_instance();
      $CI-&gt;load-&gt;library('My_PHPMailer');
  
      $mail = new PHPMailer();
      $mail-&gt;Host       = "relay-hosting.secureserver.net";
      $mail-&gt;Port       = 465;
      $mail-&gt;SetFrom('info@domain.in', 'Saurabh Pradhan');
      $mail-&gt;AddReplyTo("info@domain.in","Saurabh Pradhan");
      $mail-&gt;Subject    = $subject;
      $mail-&gt;Body      = $message;
      $mail-&gt;AltBody    = "Plain text message";
      $destino = $to;
      $mail-&gt;AddAddress($destino, "John Doe");
      if(!$mail-&gt;Send()) {
          $data["message"] = "Error: " . $mail-&gt;ErrorInfo;
      } else {
          $data["message"] = "Message sent correctly!";
      }
  var_dump($data);
  }
  </code></pre>
  
  <p>Scenario 1 (Working): If the to address is my personal gmail.id eg. pradhansp@gmail.com than the email is delivered fine.</p>
  
  <pre><code>array(1) { ["message"]=&gt; string(23) "Message sent correctly!" }
  </code></pre>
  
  <p>Scenario 2 (Not Working): If the to address is client domain info@domain.in than also i got the success message but mail is not delivered.</p>
  
  <p>An important point here is that client domain is hosted on godaddy however for email he is using google apps for work. I already looked at the MX entries on the godaddy account and they are pointing correctly to google.</p>
  
  <p>Priority | Mail Server</p>
  
  <p>1         | ASPMX.L.GOOGLE.COM.</p>