简体   繁体   中英

how to send emails from localhost in codeigniter xampp windows

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 .

It is possible to set up a mail server on Windows. You'll need a separate product for that, see eg 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.

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.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM