⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

callback after insert



Reuben Baltazar

Reuben Baltazar
  • profile picture
  • Member

Posted 23 August 2013 - 12:05 PM

when i remove the ssl://

the email function doent sends email 


briggers

briggers
  • profile picture
  • Member

Posted 23 August 2013 - 13:58 PM

OK, don't put it back.

Now you have a couple of options.

1. If you are using and IDE with debug capabilities, like Eclipse or Netbeans with Xdebug or Zenddebugger you can put a breakpoint into you code and see where it gets to. It's slow and tedious but may be the last resort.

 

2. Use Firebug in Firefox to see if you can see the problem. I'd suggest trying this first.

 

Steps

1. Put 

var_dump($post_array);
die();

immediately after the function definition line

 

2. browse to your insert page and fill in the form

3. start Firebug

4. Select Net and All in firebug then clear

5. click the "save and return..." button

6. The page will not return if it hits the mail function - if it returns to the list you know it's not calling the function

7. Expand each of the +POST or +GET lines inthe firebug window in turn and look at response tab. If there are any php or CI errors generated they will be shown here. Unfortunately when debugging GC does hid some error messages

 

If it gets into the function and there are no errors, move the die(); line down in the sendMail function to be after $this->email->send(); line and repeat the process from step 4.

 

My steps above might not be quite right but you can look at the firebug docs for more help.


mnish

mnish
  • profile picture
  • Member

Posted 01 September 2013 - 17:43 PM

Hello Reuben you can try this:-

 

1. send mail with yahoo.

config:

ssl://smtp.mail.yahoo.com

port:-465

you can set your user name and password.

 

like Amit Shah tells you check your callback_after_insert function.

 

if it works perfectly then you have to try this:

Actually if you use smtp to send mail via gmail account then it works perfectly only on local host.

but if you try it on live it's fail beacuse google take it as an unauthorized access, so first you create specific password for your Application on your gmail account then you can integrate your application password into your code you cant use your current gmail account password.

 

Actually i used this trick and it works perfectly.

 

 
 


hbs

hbs
  • profile picture
  • Member

Posted 19 September 2015 - 06:54 AM

Hi everyone, I do have same problem.

 

I am not able to send email using callback_after_insert function.

I am using CI email library to send mail.


tomomiha

tomomiha
  • profile picture
  • Member

Posted 09 February 2017 - 17:02 PM

I solved this issue by using only insert_callback, where you can manually save your

fields and after successfully saving it - you can do whatever you want to happen after saving :)

Or maybe try to call other method from within that callback, eg. $this->method($params);