Welcome Guest, Not a member yet? Register   Sign In
How do I configure the protocol mail on my localhost ?
#1

[eluser]yannyannyann[/eluser]
Hello

I don't know how to send emails using my localhost and the CodeIgniter Email Class.

This is the config I'm using:

Code:
<?php
$config['protocol'] = 'mail';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$config['newline'] = "\r\n";
$config['crlf'] = "\r\n";
?>

The debugger shows me that error :
Code:
Unable to send email using PHP mail().
Your server might not be configured to send mail using this method.

How could I solve that ?

thanks in advance !
#2

[eluser]yannyannyann[/eluser]
Do I have to worry about my php.ini settings ?

Here is what I have :

Code:
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
;sendmail_from = [email protected]

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =
#3

[eluser]slowgary[/eluser]
PHP needs to be configured to be able to use the mail() function. Specifically, it needs to know the path to sendmail (or some other SMTP server/MTA). I could be wrong about this, because after all, I'm slow.

What OS are you using? Maybe there's something lightweight that you could install for development purposes. Better yet, why not just get some hosted space for development? There are many free shared hosts out there, even with PHP, MySQL and no forced ads.

Try awardspace.com or freehostia.com
#4

[eluser]slowgary[/eluser]
One of those lines should be uncommented (Win32 OR Unix). If you're on Windows (which I think you are), remove the ; character from the beginning of 'sendmail_from' and change '[email protected]' to whatever you want the emails to come from. I still think you might need to have additional mail serving software but I could be wrong (it happens a lot).
#5

[eluser]internut[/eluser]
On my localhost I set the SMTP mail server to my domain name and as long as its a [email protected] i get the e-mails delivered.

SMTP = localhost

i do:

SMTP = mydomain.com
#6

[eluser]yannyannyann[/eluser]
cool the mydomain trick worked ! thanks !
#7

[eluser]slowgary[/eluser]
That's terrible!! What stops anyone from using your domain and passing a million spam emails through it?
#8

[eluser]yannyannyann[/eluser]
no but this is just my local MAMP installation.
Once I get online, I will define SMTP of my client.

But thanks for the warning Wink
#9

[eluser]internut[/eluser]
[quote author="slowgary" date="1239003172"]That's terrible!! What stops anyone from using your domain and passing a million spam emails through it?[/quote]

What does stop it hmmm? SMTP auth?
#10

[eluser]slowgary[/eluser]
Code:
SMTP = mydomain.net;

Doesn't that line tell PHP to route emails through your domain? There's no sign of SMTP-AUTH credentials in that file. If you're receiving those emails, then your host allows anyone to send emails through your domain. Spammer's heaven?




Theme © iAndrew 2016 - Forum software by © MyBB