Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

xampp , and codeigniter , i want to send emails from my localhost .

in ubuntu i can create an Email server very easily by

$ sudo apt-get install sendmail

and update the configuration in application/frontend/config/email.php

$config['useragent']           = "CodeIgniter";
$config['mailpath']            = "/usr/bin/sendmail"; // or "/usr/sbin/sendmail"
$config['protocol']            = "mail";
$config['smtp_host']           = "localhost";
$config['smtp_user']           = "";
$config['smtp_pass']           = "";
$config['smtp_port']           = "25";

i want to setup sendmail in windows , how can i do this ?? please help . search a lot , but could not find a working solution .

share|improve this question
There are working solutions for this, it's just harder than on Linux... But can't you use an on-line SMTP server instead? Mails from dynamic IPs get eaten by most spam filters anyway. – Pekka 웃 Dec 27 '11 at 12:24
@Pekka plese can you explain me a bit . how do i use an online SMTP server ? i tried changing php.ini SMTP = smtp.wlink.com.np smtp_port = 25 , but not working – Kanishka Panamaldeniya Dec 27 '11 at 12:28

4 Answers

It is possible to set up a mail server on Windows. You'll need a separate product for that, see e.g. here and here. XAMPP comes with a mail server bundled.

However, using a local mail server is rarely wise. Mails coming from a dynamic IP address tend to get swallowed by spam filters, as anybody can do this from any internet connection. It's better to use the SMTP server that is serving the domain name you want to use as the sender domain.

My favourite solution for that is SwiftMailer. It's a replacement for the mail() command and comes with many options. Here is an example on how to make it work with GMail.

SwiftMailer doesn't work with the mail() command though: You'll have to change your PHP code to make this work.

share|improve this answer

I remember using BLAT, a command line mailer for windows. Dead simple install and usage, providing that you have an SMTP account avalaible. I would recommend this over setting up your own server.

It does not however replace mail() directly, nor is a mail server per se, so YMMV.

share|improve this answer

Use a service like authsmtp.com or gridsend.com. I find that these work well for tracking outbound email activity, managing spam boxes, plus you don't have to worry about a different sending environment on your local machine than your production environment.

share|improve this answer

You can also try minirelay. Quite easy to use and works fine. http://www.blat.net/miniRelay/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.