logo

Enable E-mail In PHP – Win

Add comment

This will be a quick tutorial that will show you how to enable e-mail function in PHP on Windows.

What Will You Need?Top

There are few things you need to get before you can continue.

Set Up SendmailTop

After you’ve downloaded sendmail.zip and sendmail-SSL.zip, extract both zip files into same folder and place it somewhere (in my example, location is C:\Program Files\wamp\bin\sendmail). After that open sendmail.ini and change settings like this.

smtp_server=smtp.gmail.com

smtp_port=587

smtp_ssl=tls

auth_username=(account addres that you created)

auth_password=(password of that account)

Change php.iniTop

Open php.ini and find mail function section. There you’ll comment lines that contain SMTP and smtp_port. Then you’ll uncomment line that has sendmail_path and add path to sendmail.exe so you’ll have something like this.

;SMTP = smtp.example.com

;smtp_port = 25

sendmail_path = "C:\Program Files\wamp\bin\sendmail\sendmail.exe"

ConclusionTop

This is a simple way to enable PHP’s mail() function on Windows. I tested this method on Windows 7 but it should work also on XP and Vista. Thank you for reading.

Related Posts
  • 27.07.2010 -- Upload Images With MySQL (6)
    [tinytoc level="1"]Intro[/tinytoc] Ok, let's continue with tutorial requests. This tutorial will ...
  • 21.05.2010 -- Multi-Language Site (28)
    It's been a while since I last posted something because I was very busy. So let's do something usefu...
  • 07.04.2010 -- Edit XML (29)
    I had an idea about creating tutorial that will cover manipulating XML in PHP. The idea was to creat...
  • 16.10.2009 -- PHP DomDocument Tutorial (29)
    This will be a quick tutorial that will show you how to use PHP's DOMDocument to parse your XML so y...
  • 09.09.2009 -- AJAX Multi-Level Comments (55)
    In this tutorial we will create multi level comments. You must have seen comments on youtube and tha...
  • 18.08.2009 -- Permissions Using Bitwise (6)
    This will be a quick tutorial on how to use bitwise operators in PHP to create permissions control. ...
  • 11.08.2009 -- Sql Queries Cache (0)
    This will be intermediate tutorial about caching SQL query results. We will use interface to make su...

logo

11 comments to “Enable E-mail In PHP – Win”

  1. Check yout settings int php.ini and use settings as I did

  2. anik says:

    i hv done same as u suggested , but i can’t get mail :(
    i hv a warning like this

    Warning: mail() [function.mail]: Failed to connect to mailserver at “localhost” port 25, verify your “SMTP” and “smtp_port” setting in php.ini

  3. Nick says:

    Forgot to mention that I’m running Windows 7 64-bit and installed sendmail on my local IIS.

  4. Nick says:

    Works like a charm! Thank you for this tutorial :)

  5. andi says:

    okay.. this tutorial works for me…

    thank you so much dude :D

    Tested on XAMPPLite + Win7 + Gmail SMTP

  6. Hmmm. Really dont know. It works for me. Perhaps you could try it on an other computer

  7. Luis Henrique says:

    ****
    DESPERATE HERE – PLEASE HELP OUT!

    Can you imagine have done every thing – step by step – and my emails are never delivered.

    I’m I doomed???

    I would really appreciate some orientation here.
    ****

    Oh, and I forgot to mention.

    I get no erro messages, and the code that I’m using to test the mail() function is:

    // The message
    $message = “Line 1\nLine 2\nLine 3″;

    // In case any of our lines are larger than 70 characters, we should use wordwrap()
    $message = wordwrap($message, 70);

    // Send
    mail(‘zootalk@gmail.com’, ‘My Subject’, $message);

  8. Well, there are many tutorials on the Internet that talk about your problem. Just use Google to search something like PHP E-mail system.

  9. An email system . Yes I would like to have a ready made script that will send an Email to a user and his/her email .
    Where can I get that.
    I know there r paid services but i want to mess about the code myself.
    tnx

  10. What do you want to set up? E-mail system? Well, you now know how to enable it and then you can create PHP script or in any other programming language that will pull data from database (or your data storage) and send e-mails :) .

  11. Nice tutorial .Ok i have a few thousands of subscribers to my blog and i want to send a newsletters . How can I set up that in my shared server host.

    Thanks
    Please notify me when u respond to this post by my email, for I do not know when u will check this .
    cheers

Leave a Reply


 *


 *


logo
logo
Powered by Wordpress | Designed by Elegant Themes | CopyRight ©2012 php4every1.com