CodeIgniter Forums
Problem to send email to gmail adresse - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Problem to send email to gmail adresse (/showthread.php?tid=64099)

Pages: 1 2


Problem to send email to gmail adresse - Elfrancki - 01-14-2016

Hi everybody, 

When from my back office i try to send emails, it works with all domaine but not with Gmail.

When I send email to two address , one hotmail and one gmail, I only recieved it on my hotmail mail box.
In this email I can see that this email as been also sent to my gmail address but I didn't recieved it.

How can I fixed it ?


RE: Problem to send email to gmail adresse - arma7x - 01-14-2016

Spam box?


RE: Problem to send email to gmail adresse - Elfrancki - 01-14-2016

not even in the spam box.
I have checked all the mailbox.
It happens only for gmail boxes


RE: Problem to send email to gmail adresse - Diederik - 01-14-2016

Typically, emails get refused on tuns of issues: SPF DNS record, reverse DNS setup for the mailhost, DMARC settings etc. This has nothing to do with CI or gmail, it's a server thing.

Best place to start is talk to the one responsible for your server/mailserver. Do try you send it directly as smtp to gmail or do use a different smtp server?


RE: Problem to send email to gmail adresse - Elfrancki - 01-14-2016

we use smtp from gmail


RE: Problem to send email to gmail adresse - Elfrancki - 01-21-2016

Re up : I didn't find a solution...

May the config can help you ?

[root@PCS1 ~]# dig mx academiamentis.be
0 ASPMX.L.GOOGLE.COM.
5 ALT1.ASPMX.L.GOOGLE.COM.
5 ALT2.ASPMX.L.GOOGLE.COM.
10 ALT3.ASPMX.L.GOOGLE.COM.
10 ALT4.ASPMX.L.GOOGLE.COM.


RE: Problem to send email to gmail adresse - josepostiga - 01-21-2016

As @Diederik said, it's not a CI problem but a server issue. Try talking to your hosting provider? They know what to do.


RE: Problem to send email to gmail adresse - Diederik - 01-21-2016

My dig output shows another MX record for your domainname: mail.jplx.sc.

Code:
;; ANSWER SECTION:
academiamentis.be. 283 IN MX 10 mail.jplx.sc.
academiamentis.be. 283 IN MX 5 alt1.aspmx.l.google.com.
academiamentis.be. 283 IN MX 5 alt2.aspmx.l.google.com.
academiamentis.be. 283 IN MX 5 aspmx.l.google.com.
academiamentis.be. 283 IN MX 10 alt3.aspmx.l.google.com.
academiamentis.be. 283 IN MX 10 alt4.aspmx.l.google.com.

Both mail.jplx.sc and academiamentis.be point to the same IP. I suspect that your e-mail is delevered localy on your hosting server instead of to Gmail.

You could eliminate this problem by a) remove that MX record, or b) use gmail to send the messages itself instead of your local host:
PHP Code:
$config['protocol'] = "smtp";
$config['smtp_host'] = "ssl://smtp.gmail.com";
$config['smtp_port'] = "465";
$config['smtp_user'] = "[email protected]";
$config['smtp_pass'] = "Password";
$config['charset'] = "utf-8";
$config['mailtype'] = "html";
$config['newline'] = "\r\n";

$this->email->initialize($config);

$this->email->from('[email protected]''Academiamentis');
$this->email->to('[email protected]');
$this->email->subject('This is an email test');
$this->email->message('Lorem ipsum...');
$this->email->send(); 

Although it is server related you can probably circumvent the issue.


RE: Problem to send email to gmail adresse - ComputingFroggy - 01-21-2016

Hi,

In message #5, you mention you are using gmail SMTP !
So is your problem about receiving the email or about sending it ?

If you really are sending emails using gmail SMTP, then you have to declare in your gmail configuration that you will send emails from outside gmail apps.
Go to that URL for that: https://www.google.com/settings/security/lesssecureapps


Cheers,
L@u


RE: Problem to send email to gmail adresse - Elfrancki - 02-01-2016

hello, I have tried all of this, and nothing is doing beter...
Could it be possible that it is a problem with my code
I have reset all MX records like google ask.

i think it's a google App wch generate auto invite by mail