How to setup WAMP to send emails over the Gmail smtp

Oz's picture

This article explains how to setup WAMP to send emails over the Gmail smtp server using the PHP-function mail().

Software needed

Wamp - Download

Stunnel - Download

Sendmail - Download

Requirements:
Enable POP for your Gmail account
Port 465 (or 587) must be opened to the internet

Short explanation.
The smtp servers of Gmail require SSL authentication. This provides a way of authentication and encryption between your WAMP server and the Gmail smtp servers. This is not supported by default in WAMP. I will explain how this can be added with use of the SSL program "stunnel".

Step 1: Install stunnel-4.33-installer.exe on your WAMP server. Then, open the stunnel configuration file (usually "C:\Program Files\stunnel\stunnel.conf").

Here is my stunnel.conf:
cert = stunnel.pem
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
debug = 7
output = stunnel.log
client = yes
[smtpg]
accept = 127.0.0.1:25
connect = smtp.gmail.com:465
;or connect = 72.14.215.109:465 so there's no DNS lookup

Save these lines to your own stunnel configuration file. Now, stunnel can be started (Start - Programs - stunnel - Run stunnel).

Step 2: Download and extract sendmail to C:\wamp\sendmail\

Step 3: Configure your php.ini file. WAMP has three php.ini files, look in your WAMP welcome screen and cick on "phpinfo()". There you will find the location of the php.ini file which needs to be changed .
Here is my php.ini entry for the mail function:
[mail function]
; For Win32 only.
sendmail_path = "C:\wamp\sendmail\sendmail.exe -t -i"
SMTP = localhost
smtp_port = 25
Save the changes to your php.ini and STOP-START THE WAMP SERVER!

Step 4: Configure sendmail.ini. The WAMP installation contains sendmail. You will find a folder "sendmail" in your WAMP folder.
Here is my c:\wamp\sendmail\sendmail.ini entry for the mail function:
[sendmail]
smtp_server=localhost
smtp_port=25
default_domain=gmail.com
error_logfile=error.log
auth_username=[yourgmailname]@gmail.com
auth_password=[yourgmailpassword]
You should have a working sendmail functionality using Gmail's smtp-servers now!

good one

What a great post shared here. I’m very glad to find this site. keep sharing such kind of article. Thanks a lot. Must see here to explore this site. essay help keep it up

Buy online in Pakistan Buy

Using WAMP to send emails over the Gmail SMTP

Using WAMP to send emails over the Gmail SMTP is sometimes tough for the developers and they need help. I like that you are doing this for them so that they will never face such issues. Getting bestessay to resolve such issues is so common, and this idea is good to help the developers.

I have done this before. I

I have done this before. I can maybe do it again setting up wamp in my windows pc.
how to buy soundcloud plays

Pretty good post. I just

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.
pmegp etracking

Your blog title says

Your blog title says everything about you, but what makes a good title that will work and what makes a bad title that will scare people off? You might only have this one chance to get it right.
do

Looking for best writer for

Looking for best writer for research papers and essays online and i come across http://sumowritings.com. Thanks for the good work well done.

Does writing essays take up

Does writing essays take up too much of your time? Are you overwhelmed with all the research you have to do before you write? Then read on - this article will show you a method of writing that will save you precious time, lots of effort and a whole lot of headache that are usually associated with essay writing.
دانلود آهنگ

A paper writing service can

A paper writing service can help save time when trying to meet various deadlines. Students who grasp the basic concept of a class but don't have the time to write a research report or essay can use a writing service to get the job done efficiently. Essay service companies stay up to date with formats and popular topics.
do my paper for me

WAMP

From many days I was wondering how to set up the gmail configuration using the php coding. In http://topaussiewriters.com/buyassignment-com-review/ also I have read the same format which is very helpful for my work . I would really try this format and I woul say just keep sharing such posts.

WAMP

I am using internet for sending emails. But, I don't have an idea about WAMP and searched in www.analyzedu.com. After reading this post I have a clear idea about how it can be used.

Are students getting method from custom essay writing service

Most of the students are stress to completing their academic task. Essay writing work is very important task to determining the various studies based on the several online writing papers. To succeed career work the students should work hard. However, not all students have an opportunity to work hard. In this case, they should use the writing services. Best essay writing service (http://www.essayguardian.com/) and other genuine essay writing resources are maintain to maintain good writing papers and it is very important part of things should be provided by the good and genuine writing papers with perfect processes for all major students. It is offered only knowledgeable and talented writing papers and it is helps to make good and innovative writing papers for their academic works. Dissertation papers, thesis paper, assignments paper, project works, research papers and doctoral writing papers these all papers writing methods are available from this service so the students get more information and methods for their writing task and it is crucial for any student to use their creativity and imagination to succeed in academic writing.

WAMP

The provided information is really helpful for me to get know about how to setup WAMP to send emails. I have also searched in http://essaymama.org/ and got this post. After seeing this post, I have got clear idea about this setup.

How to setup WAMP to send emails over the Gmail smtp

I have learned very important points from this setup. This setup using to send emails over the gmail smtp then, people will have great opportunity. The online essay writing papers made this topic to help the users and drupal web developers.

Befitting beside of the

Befitting beside of the alteration time, we accrue on afterward the latest trends so that our bargain consistently get the a lot of abreast http://silbermanvoices.com/article-11/ Australia on our portal.

Acquiring Assistance from an Cheap Essay Writing Service: Furthe

This cheap essay writing service provides highest quality essays for customers. The writers possess higher level college and professional degrees. They have wide range of knowledge in literature, composition, history, math, chemistry, law, finance, marketing, management, business, science, sociology, psychology, technology, computer science, education, and the fine arts. In addition, because the writers carry higher level of college and professional degrees, they are experienced in writing on any level. You can approach this service for your writing guidelines.
Essay writing contains different types of methods and writing format and different essay have different format. If you are not following the correct guidelines you cannot complete the good essay. For correct advice most customers including students go for online help but most of them are in confusion with choosing a genuine online writing service to do papers. This cheap essay writing service offer best essay paper written by the professional writers. They finish your essay paper within the time you ordered.
You might want to look for an essay writing service. These forms of services will give you a lot of assistance in terms of your academic essays. You may need someone to take your original ideas and techniques to a well-structured essay making use of your material. For that an essay writing service is going to provide you with the tools you need to produce an attractive writings. This service will help you to write any academic essay topics with your needs in any time at anywhere. Students can choose this online essay writing service to make their writing works perfect.

All good till step 4 :(

I downloaded and extracted the sendmail files into my wamp dir... But there is no sendmail.ini to be found.... there are 3 other sendmail files but not the .ini file. Any suggestions?

Thanks in advance :)

Oz's picture

You might not have the correct sendmail application

It seems there are a couple different sendmail apps out there. The one I am using is from:

http://glob.com.au/sendmail/

I downloaded the archive and unzipped in my wamp directory.

Hopefully this helps

How to setup WAMP to send emails over the Gmail smtp

Hi,
I followed the steps you gave in setting up wamp server to allow for sending
mails but am still experiencing some major problems.
My mail is not sent and it keeps on timing out.
Would u kindly provide me with assistance please?
Thank you.
Tan

Oz's picture

Have you checked the error log files?

On a fresh install I walked through this tutorial and did notice my emails weren't being sent with a simple mail call. I looked in sendmail's error.txt file and noticed this:
12/06/09 11:44:30 : Message is missing sender's address

I adjusted my test script like this:

<?php

$from_name = "LocalHost";
$from_email = "xxxxxxxxx@gmail.com";
$headers = "From: $from_name <$from_email>";
$body = "Hi, \nThis is a test mail from $from_name <$from_email>.";
$subject = "Test";
$to = "xxxxxxxx@gmail.com";

if (mail($to, $subject, $body, $headers)) {
echo "success!";
} else {
echo "fail…";
}

?>

The email was sent when I included headers. Let me know if this helps, if not, please look in the error logs for more information and add it here.