Welcome Guest, Not a member yet? Register   Sign In
Email class - question
#1

[eluser]Las3r[/eluser]
Hi there,

a new day, a new question Smile

I tried sending email with the following simple page:

Code:
<?php
class Email extends Controller{

function Email(){

// load controller parent

parent::Controller();

$this->load->library('email');

}

function index(){

// set email class parameters
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'localhost';
$config['smtp_user'] = 'xxxx';
$config['smtp_pass'] = 'yyyyy';
$this->email->initialize($config);

$this->email->from('[email protected]','My name');
$this->email->to('[email protected]');
$this->email->cc('[email protected]');
$this->email->subject('Testing email class');
$this->email->message('How are you, buddy?');


$this->email->send();


echo $this->email->print_debugger();



}

}

When i use the sendmail protocol, the email arrives at my personal gmail account, but it won't get to my [email protected] (using outlook, pop3+smtp). Is this some kind of setting in my dedicated linux server?

I tried using the smtp server (with the correct user + pass + host), to send the email but i get a huge log:

Quote:220-svrx29450.xxxx.gr ESMTP Exim 4.69 #1 Tue, 03 Mar 2009 20:48:34 +0100 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.

hello: 250-svrx29450.xxxx.gr Hello localhost.mydomain.nl [127.0.0.1]
250-SIZE 52428800
250-PIPELINING
250-AUTH PLAIN LOGIN
250-STARTTLS
250 HELP

Failed to authenticate password. Error: 535 Incorrect authentication data

from: 250 OK

to: 451 Temporary local problem - please try later

The following SMTP error was encountered: 451 Temporary local problem - please try later

to: 451 Temporary local problem - please try later

The following SMTP error was encountered: 451 Temporary local problem - please try later

data: 503-All RCPT commands were rejected with this error:
503-Temporary local problem - please try later
503 Valid RCPT command must precede DATA

The following SMTP error was encountered: 503-All RCPT commands were rejected with this error: 503-Temporary local problem - please try later 503 Valid RCPT command must precede DATA
500 unrecognized command
The following SMTP error was encountered: 500 unrecognized command
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.

User-Agent: CodeIgniter
Date: Tue, 3 Mar 2009 20:48:34 +0100
From: "Erik Hoeksma"
Return-Path:
To: [email protected]
Cc: [email protected]
Subject: =?utf-8?Q?Testing_email_class?=
Reply-To: "[email protected]"
X-Sender: [email protected]
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0


Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

How are you, buddy?

I am aware that I need some kind of SMTP authentication in my OUTLOOK , do i need the same for the script?

Sending and receiving email from gmail to my personal account works, and replying works fine as well (all through outlook).


Thanks Wink
#2

[eluser]TheFuzzy0ne[/eluser]
Try using the FQDN for the smtp server instead of "localhost".

EDIT: Also, this could be a problem -> Failed to authenticate password. Error: 535 Incorrect authentication data
#3

[eluser]Las3r[/eluser]
Hmm,

well it does connect, the thing is it doesn't authenticate properly, and I wonder why? user/pass are correct (seen the fact my outlook can receive + send with the same address just fine).

Although in outlook i have to turn "enable SMTP auth verification" on.

Is there a hidden config to achieve the same in CI ?

Thanks again for your quick reply Fuzzy1
#4

[eluser]Las3r[/eluser]
I just verified that password, username are correct, tried with FQDN and localhost and ip, enabled _smtp_auth (=TRUE) in both /system/libraries/email.php and the actual controller.

What's wrong with my server... Smile ?
#5

[eluser]TheFuzzy0ne[/eluser]
Can you confirm that your username is in Email address format? e.g. [email protected]

I know your totally convinced that your user information is correct, but your log file begs to differ.

For some reason, on my home server adding smtp.mydomain.com as the SMTP server for my Email client doesn't work. I have to use mail.mydomain.com for both POP and SMTP fields. Although this might be totally unrelated, can you confirm that the MX record for your Web site is resolving? You can do this with nslookup.

Code:
nslookup
set type=mx
mydomain.com

Also, check that if the SMTP daemon uses some kind of antispam/virus (such as Clam AV), that it's actually running.

Apparently, "Temporary local problem" messages tend to be related to DNS issues, so you might want to check your DNS, ensure that you hostname is correct, and add some aliases for your server into your hosts file.
#6

[eluser]TheFuzzy0ne[/eluser]
If your still having problems, I'd suggest you look into some kind of hosting panel. I use [url="http://www.gplhost.com/software-dtc.html"]DTC[/url], which is a free hosting panel, and it manages domains, subdomains, mail, virtual hosts, antispam, and just about anything else to do with Web hosting. It might be a bit like trying to swat a fly with a bazooka, but I am not a Linux guru (although I try), so I have a Linux guru to do that work for me. I run Debian Etch, and there is a repository for DTC that makes installation almost painless. I've tried to learn to administer my system myself, but I usually end up with a broken system, so I just don't bother any more.

I'm guessing that you'll be running something like Red Hat. I'm sure DTC will work equally well with that too, so if you're interested, give it a shot and see what you think. It's totally free. Another on I used to use but didn't offer the level of assistance I required is [url="http://ispconfig.org/"]ISPConfig[/url] (also free). I also found that ISPConfig was a bit more problematic during installation, requires a fresh system install, and makes a lot of modifications to your system. ISPConfig is a very good control panel, but DTC is by far the best I've found yet.




Theme © iAndrew 2016 - Forum software by © MyBB