Skip to content

Instantly share code, notes, and snippets.

@danieldogeanu
Last active July 31, 2024 17:22
Show Gist options
  • Save danieldogeanu/92e7f0b4d584842994521f08dafc306d to your computer and use it in GitHub Desktop.
Save danieldogeanu/92e7f0b4d584842994521f08dafc306d to your computer and use it in GitHub Desktop.
How to configure Wamp Server to send email with sendmail.

1. Download and Configure Sendmail for Windows:

  • Download Sendmail for Windows;
  • Extract sendmail.zip and place the contents in an easily accessible place, like C:\sendmail;
  • Open the sendmail.ini file using a text editor such as notepad and edit the following values:
    [sendmail]
    smtp_server=mail.example.com
    smtp_port=465
    [email protected]
    auth_password=your_password
    

2. Edit the php.ini File:

  • Comment out the unnecessary lines (put a semicolon before them):
    [mail function]
    ; For Win32 only.
    ;SMTP = localhost
    ;smtp_port = 25
    
  • Uncomment sendmail_path and point it to where sendmail.exe file resides:
    ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
    sendmail_path = C:\sendmail\sendmail.exe
    
  • Save the php.ini file and restart all web services.

NOTE: For emails to be sent through an external SMTP server your computer must be connected to the internet!

If this was useful, you can buy me a coffee here. Thank you!

@Adeeb456
Copy link

I've downloaded send mail for windows and extracted all the files in C://wamp64/sendmail but is has just 5 files and only 1 configuration file having some xml code inside it.
What should I do?

@danieldogeanu
Copy link
Author

@Adeeb456 Apparently the guy who created the fake sendmail, no longer supports it and it's deprecated. But as he pointed out, you can follow this link to an updated version maintained by someone else, and follow the instructions there.

I personally haven't used this in a long time, so I can't tell you how to fix it.

@Olamify
Copy link

Olamify commented Dec 26, 2023

Please how do you test if it works?

@danieldogeanu
Copy link
Author

@Olamify You send the email from your PHP application or CMS that you have installed. If you're building a WordPress site, create a page with a contact form and send email from it. It should work automagically! If it's not, as the instructions say, check your antivirus (some block port 25), or make sure your ISP allows you to send traffic on port 25.

@Olamify
Copy link

Olamify commented Dec 27, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment