1

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 .

Justin T.
  • 3,643
  • 1
  • 22
  • 43
Kanishka Panamaldeniya
  • 17,302
  • 31
  • 123
  • 193
  • 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 Answers4

3

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.

Community
  • 1
  • 1
Pekka
  • 442,112
  • 142
  • 972
  • 1,088
1

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.

Justin T.
  • 3,643
  • 1
  • 22
  • 43
0

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.

phirschybar
  • 8,357
  • 12
  • 50
  • 66
0

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

luso
  • 2,812
  • 6
  • 35
  • 50