Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending Mail using PHP Mail function - Local mail server?

Tags:

php

email

I am trying to send an e-mail from localhost but am getting the error:

Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set().

Does this mean i need to set up a local mail server?? and if so how and which one is easiest.

Thanks in advance

Paul

like image 397
Pjn2020 Avatar asked May 19 '26 20:05

Pjn2020


1 Answers

This is what I use, but it's for testing purposes only:

http://www.toolheap.com/test-mail-server-tool/

There's almost no configuration, and I got it to work right out of the box (on Win7) after failure with several other mail servers. It does not send the actual mail, but stores it as an .eml file. This is great for testing mailing lists for instance, where you don't really want to send the 2000 emails, but want to get a realistic result from your application.

It might look like garbage, but it's been working great for me.

like image 77
Wesley Murch Avatar answered May 22 '26 09:05

Wesley Murch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!