How to configure emails with WAMP easily

Web programming topics
Post Reply
User avatar
Saman
Lieutenant Colonel
Lieutenant Colonel
Posts: 828
Joined: Fri Jul 31, 2009 10:32 pm
Location: Mount Lavinia

How to configure emails with WAMP easily

Post by Saman » Wed Jun 30, 2010 12:34 am

Until we move the website after finishing development to the web hosting server, it is mostly not easy to test the php mail function with WAMP server. Unless your ISP provides you a smtp server, this is not usually possible.

There is one easy solution to test email with WAMP.
  1. Download ArGoSoft Mail Server Freeware
    You can find Version 1.0.0.3 here. This is free for non-commercial use.
    MailServerFreeSetup.zip
    (408.19 KiB) Downloaded 1353 times
  2. Install it.
  3. Go to Users and Domains
  4. Add domain robot.lk (make sure you add your domain here)
  5. Add user admin with password test123 (You may add all the email addresses that you may use for testing)
  6. Make sure php.ini has following settings

    Code: Select all

    [mail function]
    ; For Win32 only.
    ; http://php.net/smtp
    SMTP = localhost
    
    ; http://php.net/smtp-port
    smtp_port = 25
    
  7. Write following code on a php file and place it under www root of WAMP

    Code: Select all

    <?php
    $headers = 'From: [email protected]' . "\r\n";    
    mail('[email protected]', 
         'my message subject', 
         'hi, its me',
         $headers);
    ?>
    
  8. Open your browser and run this file
  9. Now we need to configure your mail client with following settings.
    Email Address: [email protected]
    Account type: POP3
    Incoming mail server: localhost
    Outgoing mail server: localhost
    User name: admin
    Password: test123
  10. You can create more users and use those email addresses for testing.
Enjoy!
User avatar
Shanoger
Posts: 2
Joined: Tue Aug 17, 2010 10:05 pm

Re: How to configure emails with WAMP easily

Post by Shanoger » Wed Aug 18, 2010 12:04 am

I have a WAMP and trying to send an email using PHP code, i followed the instructions on how to configure the ArGoSoft mail server and these are the details i plugged in the "Users and Domains" tab
In domain: mail.hotmail.com
In user: [email protected] along with my password

then i tried to run the php code (sending email to my self test purpose):
1.
2. <?php
3. $headers = 'From: [email protected]' . "\r\n";
4. mail('[email protected]', 'my message subject', 'hi, its me', $headers);
5. ?>

when i run this using my browser i get
Warning: mail() [function.mail]: SMTP server response: 501 Account does not exist in C:\wamp\www\sendmail.php on line 4

Please help me with this issue...
User avatar
Saman
Lieutenant Colonel
Lieutenant Colonel
Posts: 828
Joined: Fri Jul 31, 2009 10:32 pm
Location: Mount Lavinia

Re: How to configure emails with WAMP easily

Post by Saman » Wed Aug 18, 2010 2:18 am

Under Users and Domains. for domain, add hotmail.com instead of mail.hotmail.com and in user just myemail instead of [email protected].

Hope that helps!
User avatar
Shanoger
Posts: 2
Joined: Tue Aug 17, 2010 10:05 pm

Re: How to configure emails with WAMP easily

Post by Shanoger » Wed Aug 18, 2010 4:11 pm

Yes it worked. What i am really trying to do is send a simple mail to my hotmail account using a web page that is running on my local network (wamp), but the PC on which it is running on is connected to the internet. I did the changes as you recommended but i did not find any email in my hotmail account. One more thing if the code worked where did the message go and how can i view it. Thanks in advance...
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: How to configure emails with WAMP easily

Post by Neo » Wed Aug 18, 2010 4:59 pm

You must be able to see the log of the mail server with error messages.
I think the problem is that you are not allowed to send emails outside the list in mail server.

You only can simulate your hotmail account. You need configure a mail client to see the messages. (Thunderbird is a free mail client).

Later when you move it in to your real server, you'll start getting emails on your real hotmail account.
Mysoogal
Captain
Captain
Posts: 223
Joined: Thu Dec 17, 2009 7:15 am
Location: Planet VPS

Re: How to configure emails with WAMP easily

Post by Mysoogal » Wed Jan 05, 2011 9:27 am

hey neo, you know how to setup newsgroup server ? :mrgreen: hmailserver.com/ is another open source free mail server
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: How to configure emails with WAMP easily

Post by Neo » Wed Jan 05, 2011 11:21 am

hMailServer seems interesting. It's free & open source :)
Mysoogal
Captain
Captain
Posts: 223
Joined: Thu Dec 17, 2009 7:15 am
Location: Planet VPS

Re: How to configure emails with WAMP easily

Post by Mysoogal » Thu Jan 06, 2011 12:53 am

Neo wrote:hMailServer seems interesting. It's free & open source :)
I've actually tried to setup this server but i couldn't get to the point where i wanted to use sub-domain from noobserver.no-ip.org
Post Reply

Return to “Web programming”