We are using amazon server and I am using PHP, Codeigniter framework.
Below is the script which I am using for sending emails. It is working when I send an email to Gmail domain email id (abc@gmail.com) but it is not working on some specific domain name email id (abc@xyzdmainname.com).
public function sendMail() {
$to = 'abc@xyzdomain.com';
$fromEmail = 'pqr@gmail.com';
$fromName = 'pqr';
$subject = 'Testing';
$message = 'Testing of email';
$newFile = ''
$this->CI->load->library('email');
$this->CI->email->mailtype = 'html';
$this->CI->email->from($fromEmail, $fromName);
$this->CI->email->to($to);
$this->CI->email->subject($subject);
$this->CI->email->message($message);
if (!empty($newFile)) {
$this->CI->email->attach($newFile);
}
$result = $this->CI->email->send();
$message = '';
if ($result) {
return 1;
} else {
echo $this->CI->email->print_debugger();
return 0;
};
Please let me help what-what case may be here for fail sending email on a particular domain.
and How I can overcome this issue.