Welcome Guest, Not a member yet? Register   Sign In
I am new and in problem - mail library - sending emails using SMTP

Trying to send email using protocol = SMTP on windows. Have provided the user id, password and SMTP server address as well..
I get an error
Quote:Fatal error: Maximum execution time of 90 seconds exceeded in E:\inetpub\vhosts\xyz.com\httpdocs\cxvx\libraries\Email.php on line 1812
Any guesses?

Also, Do I need to set SMTP settings in PHP.ini to send SMTP emails using CI's mail library's SMTP?

[eluser]Evil Wizard[/eluser]
Yes and you'll probably want a smtp server too

I don't have access to php.ini file so I did this in the constructor:
function __construct()
        //More Stuff

Same error..

How many Emails are you attempting to send at any one time?

two seperate emails.

Are you able to send mail using the Web interface provided by your Web host?

Yes I can

Please post your controller code, and the config settings you're using for the Email library. I use SMTP, and I've not needed to change anything in the php.ini - It's all configured via CodeIgniter.

class Contact extends Controller {

    function __construct()
    function complaints_and_suggestions()
            //Create Email - Other Code not shown here
            $message = "Following has been received:\n\n";
            $message .= "First Name   : ".$this->input->post('fname')."\n";
            $message .= "Last Name    : ".$this->input->post('lname')."\n";
            $message .= "Email        : ".$this->input->post('email')."\n";
            $message .= "Contact No.  : ".$this->input->post('contact')."\n";
            //Send Email to Staff    
            $this->email->from('[email protected]', 'Administrator');
            $this->email->to('[email protected]');                
            $this->email->subject("Some Subject");
            //Send Email to Visitor
            $message = "Respected site visitor.\n\n";
            $message .= "Thank you for submitting your comments\n";
            $this->email->from('[email protected]', 'Site Administrator');
            $this->email->subject("Your Comments");
            redirect('contact/success', 'location');

Email Configuration - from file email.php residing in config directory

$config['protocol'] = 'smtp';
$config['smtp_host'] = 'mail.theServer.com';
$config['smtp_user'] = '[email protected]';
$config['smtp_pass'] = 'pass';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;

I'd suggest that you comment out all of the code in your method, and uncomment it line by line, until you find where the problem is. If that fails, then I'd suggest you try sending the Email with sendmail, and seeing if that makes any difference.

Theme © iAndrew 2016 - Forum software by © MyBB