![]() |
Add a comment and email the comment to notify all email addresses in the database - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Add a comment and email the comment to notify all email addresses in the database (/showthread.php?tid=60688) |
Add a comment and email the comment to notify all email addresses in the database - El Forum - 06-03-2014 [eluser]Neoraj3.0[/eluser] Hi I am trying to get a much simpler version of adding a comment to a topic in blog and as the comment is added an email i sent to very email address in my database. I works fine on my local system 'localhost' but the email does not work on the live site on 000webhosts. Please help. These are the errors: Message: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (Connection timed out) Filename: libraries/Email.php Line Number: 1689 Message: fwrite(): supplied argument is not a valid stream resource Filename: libraries/Email.php Line Number: 1846 this is the Model: Code: function get_comment_for_email(){ This is the Controller: Code: <?php Add a comment and email the comment to notify all email addresses in the database - El Forum - 06-04-2014 [eluser]Unknown[/eluser] Is port 465 open for use between your host and the target? Add a comment and email the comment to notify all email addresses in the database - El Forum - 06-04-2014 [eluser]CroNiX[/eluser] Break it down. First get rid of sending in a loop until you get a single email working. Use the debugging method available to the email class. It might provide more info ($this->email->print_debugger()). Make sure port 465 is open. Try other ports like port 587, etc. Add a comment and email the comment to notify all email addresses in the database - El Forum - 06-04-2014 [eluser]Neoraj3.0[/eluser] Well i used telnet to check port 25, 465 and 587 they are all open. I also called my ISP they said they are dont have any blocks on. I guess i can contact the host also. What messages should I be looking for in the debugger? Add a comment and email the comment to notify all email addresses in the database - El Forum - 06-05-2014 [eluser]InsiteFX[/eluser] Why are you using gmail? Use your hostings SMTP server. Add a comment and email the comment to notify all email addresses in the database - El Forum - 06-05-2014 [eluser]Neoraj3.0[/eluser] Well I also did that today. My host sent me this info which I used: Username: [[email protected]] Password: [the password you set up when you configured your mail box] Incoming Mail Server: [mail.domain.ext] Outgoing Mail Server: [smtp.domain.ext] Outgoing Server requires Authentication (typically found in advanced options or settings) Use Same Username and Password as Incoming Incoming Server Port: 110 (POP3) Incoming Server Port: 143 (IMAP) Outgoing Server Port: 2525 (POP3/IMAP) Outgoing Server Port: 587 (Verizon Carrier) **Authentication: Password **Please Turn Off the SSL Connection for both Incoming and Outgoing Server Settings. I first used this (below) and got the same error "fsockopen(): unable to connect to smtp" etc Code: $email_config = Array( Then I tried the Verizon port 587 just for fun but same results: Code: $email_config = Array( Add a comment and email the comment to notify all email addresses in the database - El Forum - 06-05-2014 [eluser]InsiteFX[/eluser] Code: $this->load->library('email'); // This should not be in your foreach loop. Add a comment and email the comment to notify all email addresses in the database - El Forum - 06-07-2014 [eluser]Neoraj3.0[/eluser] Thanks InsiteFX I placed $this->load->library('email'); above the for each loop but got the same results. On a positive note, I got the email with comment to work when I change 'protocol' => 'smtp' to 'protocol' => 'mail' but the email is much slower and renders the css in the email too. But if anyone has any other ideas for making it work with smtp that would be great. I wondering if I should just change web hosts. Are there any web hosts that are know to be good with providing smtp? |