CodeIgniter Email Class Shows Email Credentials after $this->email->send() |
[eluser]arylaarsdam[/eluser]
I've searched for a solution for this but could not find one, so here goes... I am not using print_debugger(), yet after I hit send on my form and the $this->email->send() function processes the email and sends it, the next window that opens in my browser shows all of my login credentials for the email account that I am using to send emails through. Messages are being sent successfully so I don't think this is an error. I would like for the user to be redirected to the prior page they were on with a message at the top that says 'Message Sent Successfully'. First, does anyone know why I am seeing all my email credentials displayed when I'm not using the debugger and second, after the email controller runs when the user presses send, how do I build it that it redirects the user to the prior page with a message that says that the message was successfully sent (or an error indicating that it wasn't sent)?
[eluser]Tpojka[/eluser]
First thing first: post controller with coresponding method in here.
[eluser]arylaarsdam[/eluser]
My apologies for not posting the actual code. I wrote this from work thinking I could get to my code from there, but I couldn't. This is controller that processes my email form. Like I said, the email sends successfully. However, the resulting page that shows in the browser shows all the email credentials I have set in my email.php config file. Code: function contact_seller() { The resulting page shows this at the top of the page: $config['protocol'] = 'smtp'; $config['smtp_host'] = 'ssl://SMTPSERVERINFOHERE'; $config['smtp_user'] = 'SMTPUSERINFOHERE'; $config['smtp_pass'] = 'SMTPPASSWORDHERE'; $config['smtp_port'] = '465'; $config['mailtype'] = 'html'; $config['charset'] = 'utf-8'; A PHP Error was encountered Severity: Warning Message: Cannot modify header information - headers already sent by (output started at /home1/abcdefg/public_html/2013dev/application/config/email.php:7) Filename: libraries/Session.php Line Number: 675 Lastly, here is the code from my email.php config file: Code: $config['protocol'] = 'smtp'; Any thoughts on why the email credentials are displayed at the top of the subsequent page after the email sends? Any thoughts on how to properly display a message that either says 'Email sent successfully' or 'Email did not send, please try again later'? Thank you!
[eluser]Tpojka[/eluser]
What looks like this method: Code: index($this->session->userdata('lastviewedproperty')){}
[eluser]arylaarsdam[/eluser]
Code: function index($mypropertyid) {
[eluser]Tpojka[/eluser]
Very complex code. I will check it in the morning again. Too late for me now, sorry. Edit: What is going on when you try to pass index function/method without sending mail - is that with no errors?
[eluser]arylaarsdam[/eluser]
No worries. I appreciate you taking a look at it. Essentially all this code does is pulls all data about a property listing and loads that into various arrays that are used by the propertydetail view. This code works great to load the Property Detail page in the first place but the error comes when the page is reloaded after the email contact_seller method runs. The complexity of the code in the index function is pretty much just in the loading of arrays that the view uses to display all of the information it needs.
[eluser]arylaarsdam[/eluser]
I got this resolved. Stupid mistake by me by not adding opening PHP tag to my email.php config file. Email.php config file should look like this: Code: <?php // I did not have this before. Rookie mistake.
[eluser]Tpojka[/eluser]
Silly. ![]() Use some reach code editor so you can spot different colors between distinct string/data types in it. |
Welcome Guest, Not a member yet? Register Sign In |