![]() |
Help with email - I'm new to CI - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Help with email - I'm new to CI (/showthread.php?tid=31355) |
Help with email - I'm new to CI - El Forum - 06-16-2010 [eluser]ChaosKnight[/eluser] Hi, I started using CI yesterday and I'm loving it! There's only a few things that still bothers me... Firstly I find my own code very... very... very... slow... I don't know if it's only because I haven't enabled the cache yet. If someone can find the time to quickly look through my controller code, I'd really appreciate any help. Contact controller Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); At the moment that code does nothing, I can't see why... The contact view is very basic, it's only a page with 4 fields (name, email, subject and message) If someone can tell me why it's so slow and what I did wrong, I would be really grateful, thanks! Oh and the email config page is where the tutorial told me to put it config/email.php Thanks! Help with email - I'm new to CI - El Forum - 06-16-2010 [eluser]mddd[/eluser] Code: $this->email->from('[email address]','[name]'); Code: $this->email->from(set_value('email'), set_value('name')); Also, if you use information from POST and you use the validation library, DON'T call the POST variables directly! Otherwise what's the point.. So in stead of this: Code: $this->email->subject($_POST['subject']); Code: $this->email->subject(set_value('subject')); Help with email - I'm new to CI - El Forum - 06-16-2010 [eluser]ChaosKnight[/eluser] Thanks for your reply, I have used my real mail address there, I only took it out when I posted my code here, I once posted my real address on a forum and I got spammed like hell... I'll implement your other suggestion, thanks for that... But do you perhaps know why it's so slow? Thanks! [Edit]: The email still doesn't get sent, it only loads extremely long, about 30 to 60 seconds, then the page just returns empty, not even the views are sent back to the browser Help with email - I'm new to CI - El Forum - 06-16-2010 [eluser]daelsepara[/eluser] is sendmail, postmaster, (or equivalent) configured properly? on a linux machine, you can test whether or not a simple message gets sent. Help with email - I'm new to CI - El Forum - 06-16-2010 [eluser]mddd[/eluser] I agree with that last post. If email sending isn't configured correctly, the server could be trying to find a server that doesn't exist.. it will stop trying after a certain timeout (30 seconds?).. that will make it very slow indeed. Help with email - I'm new to CI - El Forum - 06-16-2010 [eluser]ChaosKnight[/eluser] I am upgrading an existing PHP website to CodeIgniter, the host unfortunately only has Windows servers running IIS, but on the previous pages I have managed to send the email from the Contact page quite fast. The mail server only requires normal SMTP authentication, and only allow the outgoing SMTP protocol. Here is the email.php file located at application/config: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Is there additional settings that I have left out? The host uses the default port. Help with email - I'm new to CI - El Forum - 06-16-2010 [eluser]daelsepara[/eluser] have you tried a telnet command to the host and port to see if it responds? if it does it could be that the smtp host does not know where to route your emails. Help with email - I'm new to CI - El Forum - 06-16-2010 [eluser]ChaosKnight[/eluser] The host offers a control panel, I checked in the control panel, and forwards all the mail correctly... I'll check everything again, thanks Help with email - I'm new to CI - El Forum - 08-13-2010 [eluser]RonMcClung[/eluser] I am having similar difficulty with the same kind of situation... SMTP Auth, on a Windows/IIS box. I get the 30 sec timeout... set the smtp_timeout to 300... default port.... What am I doing wrong? |