Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup mail in XAMPP locally?

I'm learning PHP and have installed XAMPP on my computer.

But I have a problem with the setup as the email option doesn't seem to be working.

After doing some reading I think it has something to do with the below, found on my server in the php.ini file

[mail function]    ; For Win32 only.    ; *hp://*php.net/smtp    SMTP = localhost   ; http://php.net/smtp-port    smtp_port = 25       ; For Win32 only.    ; http://php.net/sendmail-from    ;sendmail_from = postmaster@localhost    

Is there anything I need to change? I have seen software such as swiftmailer mentioned but I don't know if XAMPP has this included already?

like image 696
James Avatar asked Jan 10 '11 23:01

James


People also ask

Can I send email from localhost XAMPP?

You can send mail from localhost with sendmail package , sendmail package is inbuild in XAMPP. So if you are using XAMPP then you can easily send mail from localhost. For example, you can configure C:\xampp\php\php. ini and c:\xampp\sendmail\sendmail.

Can I send email using localhost?

If you want to send emails from localhost directly, you need to install a Mail Transport Agent (MTA), or if you like, a SMTP service. IIS provides one. You can otherwise find some others on Google.

Can I send email from localhost php?

Send Email from Localhost with PHPSet SMTP credentials (host, username, password, and port). Specify sender name and email ( $mail->setFrom ). Set recipient email address ( $mail->addAddress ). Set email subject ( $mail->Subject ).

Can we send mail from localhost in laravel?

Laravel provides drivers for SMTP, Mailgun, Mandrill, SparkPost, Amazon SES, PHP's mail function, and sendmail , allowing you to quickly get started sending mail through a local or cloud based service of your choice.


1 Answers

My favorite smtp server is hMailServer.

It has a nice windows friendly installer and wizard. Hands down the easiest mail server I've ever setup.

It can proxy through your gmail/yahoo/etc account or send email directly.

Once it is installed, email in xampp just works with no config changes.

like image 157
Byron Whitlock Avatar answered Oct 18 '22 00:10

Byron Whitlock