you’re reading...

Softwares

How to use Sendmail in Windows

Your Ad Here

Using sendmail is very useful in web development, to easily check if your mail scripts are working. Using it on desktop desktop environment will give you added benefit of sending e-mail from your own computer. However configuring sendmail in Windows environment will still require you to use your ISP’s mail server for purposes of relaying your email. For these purpose we need to configure a web server including the sendmail program. We can either use Apache or IIS for these, but since Apache XAMPP distribution have all these software in place we might just as well use it. Obtain the Apache XAMPP distribution from apachefriends.org

Follow the server’s installation instruction, after that we are ready to configure the sendmail program. Make sure that your server is running by pointing your browser to http://localhost or http://127.0.0.1.

We can find the sendmail program in the directory where we install the XAMPP distribution in my case I put it in D:\XAMPP my sendmail is located in D:\XAMPP\sendmail\

There are two important configurations that we need to touch in order for the sendmail program to work. One is the sendmail.ini which can be found in our sendmail directory in my case that is D:\XAMPP\sendmail\sendmail.ini

We need to put the following code in our sendmail.ini:

smtp_server=yourserver.domain.com
smtp_port=25
smtp_ssl=auto
default_domain=domain.com
auth_username=admin@domain.com
auth_password=password
pop3_server=yourserver.domain.com
pop3_username=admin@domain.com
pop3_password=password
force_sender "just leave blank"
hostname= "just leave blank"

The other one is the php.ini configuration of the PHP XAMMP distribution which can be found in D:\XAMPP\apache\bin\php.ini

For the PHP.ini look for the sendmail path and change it to:

sendmail_path = “D:\xampp\sendmail\sendmail.exe -t”

Restart your Apache installation and let us test our sendmail configuration using the following script


#enclose the following in php tags and save as emailtest.php

$from_name = 'This Sender is testing';
$from_email = 'admin@yourdomain.com';
$headers = "From: $from_name <$from_email>";
$body = "Hi, \nThis is a test mail from $from_name <$from_email>.";
$subject = "Test mail from this sender";
$to = 'noreply@eg-designstudio.com';

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

If your configuration is correct you will received the following message in your inbox:

Sendmail Message

Your Ad Here

Listen to this post Listen to this post

Discussion

No comments for “How to use Sendmail in Windows”

Post a comment

You must be logged in to post a comment.

Thailand Interior Designer

Oliver & Associates
QR CODE
Earn $$ with WidgetBucks!

Register and Participate

Registration to this website is free. Feel free to use and explore the features of the website. You are welcome to participate and interact with us in the forum. If you have concerns that you want us to know you can easily contact us using this link. By registering in this website, your account will allow you to login and participate in the forum and to access additional information that is only available to registered users. We are keeping this website to be informative for us and to our users.

Register/Login

Syndication

feeds

Podcast Subscribe

Link to Podcast (RSS feed) for this blog

Bluehost

Site Counter

total of 171094 visits

Google 1(One) Day Stat


21
Unique
Visitors
Powered By Google Analytics
Get Adobe Flash playerPlugin by wpburn.com wordpress themes

Download Our Community Browser Toolbar