Page 1 of 2

How config send email on localhost when register accounts?

Posted: Fri Jan 07, 2011 2:38 am
by sakybc
Hi all !
i setup Alegrocart on localhost.
my site: localhost/vien
my directory: D:\xampp\htdocs\vien
when user register, it will sent email with error :

Warning: mail() [function.mail]: SMTP server response: 553 We do not relay non-local mail, sorry. in D:\xampp\htdocs\vien\library\mail\mail.php on line 179

Warning: mail() [function.mail]: SMTP server response: 553 We do not relay non-local mail, sorry. in D:\xampp\htdocs\vien\library\mail\mail.php on line 179

Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\vien\library\mail\mail.php:179) in D:\xampp\htdocs\vien\library\environment\response.php on line 23

when Enter again will see:

Notice: Undefined variable: url in D:\xampp\htdocs\vien\catalog\controller\account_create.php on line 30

Fatal error: Call to a member function ssl() on a non-object in D:\xampp\htdocs\vien\catalog\controller\account_create.php on line 30

Please help me.Thanks you very much.

Re: How config send email on localhost when register accoun

Posted: Fri Jan 07, 2011 4:16 am
by Brent
In XAMPP\php\php.ini goto to line 1100
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = yourmailsever.com uncomment this line (remove semi-colon ( ; )at the start )
;username = xxxxxx
;pasword = xxxxx
; http://php.net/smtp-port
smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = admin@validemailserver.com uncomment this line (This one is optional)

you can use the same mail server information the you use on this computer to send email.

As for the messaged on line 30 when you try again, it is a bug you found. You are actually logged in.
Only the email response did not happen, but the customer account was created.
account_create.php line 30 is

Code: Select all

$this->response->redirect($url->ssl('account'));
should be

Code: Select all

$this->response->redirect($this->url->ssl('account'));

Re: How config send email on localhost when register accoun

Posted: Fri Jan 07, 2011 2:24 pm
by citadmin
Brent I new to AlegroCart. This my issue and how do I fix it? Thanks

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\alegrocart\tasteofafrica\library\mail\mail.php on line 179

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\alegrocart\tasteofafrica\library\mail\mail.php:179) in C:\xampp\htdocs\alegrocart\tasteofafrica\library\environment\response.php on line 23

Re: How config send email on localhost when register accoun

Posted: Fri Jan 07, 2011 3:29 pm
by Brent
Give me a few hours and I'll come up with something that will fix the test site problem.

Re: How config send email on localhost when register accoun

Posted: Fri Jan 07, 2011 6:09 pm
by Brent
I have place 3 options to work a round this problem on windows servers.
Mail FAQ

Re: How config send email on localhost when register accoun

Posted: Fri Jan 07, 2011 7:00 pm
by citadmin
Brent

Thanks for the solution you posted in Mail FAQ. I host my sites on my two windows boxes, so they are technically not test sites. I want to be able to configure AlegroCart sites to send mail using email address and smtp server on port 465. Will what you posted in Mail FAQ work? I don't want to have to install a mail server no my box just I can send mail.
Thank you for your help and much respect.

Re: How config send email on localhost when register accoun

Posted: Sat Jan 08, 2011 6:30 am
by Brent
The first solution is what you need to use. When you set the SMTP in php.ini, the mail function is available for all sites.
Just below the SMTP = your valid mail.XXXX. smtp, You will set a port setting smtp_port = 25
Change this to smtp_port = 465
You will have to stop and start apache to make changes in php.ini take effect.
Let me know how it works out for you.

Re: How config send email on localhost when register accoun

Posted: Sat Jan 08, 2011 6:49 am
by citadmin
Heya Brent

My smtp requires a username = user@att.net and password = email password. How would you add those in php.ini?

Thanks

Re: How config send email on localhost when register accoun

Posted: Sat Jan 08, 2011 10:33 am
by Brent
Try adding to php.ini:

Code: Select all

username = USERNAME
password = YOUR_PASSWORD
I have never tried it.
I use HMAIL mail server on a windows server. I have set it up to use the ISP SMTP and handle authentification.
It will allow you to handle many email accounts through one server.

Re: How config send email on localhost when register accoun

Posted: Sat Jan 08, 2011 5:05 pm
by citadmin
Okay Brent, I have downloaded HMail. I will do a full install later on tonight. The obvious question is how do I configure it AlegroCart to work with HMail? Which PHP files do I need to modify to get it to work? I will check back after I finish my HMail Server install. Thanks