Saminnet-Search Article Wiki Forum Blog SNS Cloud
IIS7 SMTP

  • Data-Articles
    • Kidney test method Thu13,09:39am

      There are different tests that healthcare professionals use to measure kidney function. Overall, these blood and urine tests are used to find out how well your kidneys are working, check for signs ofツkidney disease, and look for any changes in a person窶冱 kidney health over time. The earlier kidney disease is found, the better the chance of slowing or stopping it from getting worse. ツ ツ Serum…

      Read More...

IIS7 SMTP

The SMTP server is not installed by default.

  1. Open Server Manager by right-clicking onツMy Computer, and selectingツManage. (Alternately, openツControl Panel, click onツPrograms and Features, and then selectツTurn Windows features on or off.)
  2. UnderツFeatures, selectツAdd Features.
  3. Select theツSMTP Serverツcheck box.
  4. ClickツAdd Required Role Services. If there are any missing roles required for the SMTP installation, Windows Serverツョ 2008 R2 or Windows Serverツョ 2008 installs them. ClickツNext.
  5. You need to step through the entire wizard again, even though IIS is already installed (IIS 6 Management Compatibility and the IIS 6 Management Console must be installed for SMTP to work).

    Figure 1: Confirm Installation Selections

  6. PressツCloseツwhen installation is complete.

Configure SMTP E-Mail for a Web Application

Once you add SMTP, you can configure it for your PHP applications. This can be done by using the user interface (UI), by running Appcmd.exe commands from a command prompt, by editing configuration files directly, or by writing Windowsツョ Management Instrumentation (WMI) scripts. Note that you must have IIS installed before enabling SMTP.

Use the User Interface

  1. OpenツInternet Information Services (IIS) Manager, and then navigate to the level you want to manage.
  2. Features View, double-clickツSMTP E-mail.
  3. On theツSMTP E-mailツpage, type the e-mail address of the sender in theツE-mail addresstext box.
  4. On theツSMTP E-mailツpage, select one of the following delivery methods:

    • Deliver e-mail to SMTP server:ツto deliver e-mail messages immediately. This requires an operational SMTP server for which the user has credentials.
    • Store e-mail in pickup directory:ツto store e-mails in a file location on disk for later delivery by the PHP application (or by a Microsoftツョ ASP.NET application or by a user).
  5. IfツDeliver e-mail to SMTP serverツis selected, do the following:

    • Type the unique name of your SMTP server in theツSMTP Serverツtext box, or select theツUse localhostツcheck box to set the name toツLocalHost. Setting the name to LocalHost means that ASP.NET uses an SMTP server on the local computer. Typically, this is the default SMTP virtual server.
    • Enter a TCP port in theツPortツtext box. Port 25 is the SMTP standard TCP port and is the default setting. More than one virtual server can use the same TCP port if all servers are configured by using different IP addresses.
    • UnderツAuthentication Settings, specify the authentication mode and credentials if your SMTP server requires these.
  6. IfツStore e-mail in pickup directoryツis selected, type the batch e-mail location in theツStore e-mail in pickup directoryツtext box.
  7. ClickツApplyツin theツActionsツpane.

Use the Command Line

You can configure IIS so that e-mail is delivered immediately or stored for later delivery.

Deliver e-mail messages immediately

To configure SMTP e-mail to deliver e-mail messages immediately, use the following syntax:

console
C:\%windir%\system32\inetsrv\appcmd set config /commit:WEBROOT /section:smtp /from: string /deliveryMethod:network /network.port: int /network.defaultCredentials:True|False /network.host:string /network.userName:string /network.password:string

The variableツfromstringツis the e-mail address of the sender. The variableツ/deliveryMethod:networkツconfigures IIS to deliver e-mail messages immediately. The variableツ/network.portintツsets the TCP port that is used by IIS to deliver e-mail messages. The variableツ/network.hoststringツspecifies the host used for SMTP transactions. The variableツnetwork.defaultCredentials:True|Falseツenables or disables authentication using the default network credentials. IfツdefaultCredentialsツis set toツTrue, Kerberos or NTLM are used if the server supports these protocols. The variablesツnetwork.userName:stringツandツnetwork. password:stringツset a basic authentication user name and password.

Store e-mails for later delivery

To configure SMTP e-mail to store e-mails in a file location on disk for later delivery by an application, such as an ASP.NET application, or by a user, such as an administrator, use the following syntax:

console
C:\%windir%\system32\inetsrv\appcmd set config /commit:WEBROOT /section:smtp /from: string /deliveryMethod:PickupDirectoryFromIis|SpecifiedPickupDirectory /SpecifiedPickupDirectory:string

The variable from string is the e-mail address of the sender. The variable/deliveryMethod:PickupDirectoryFromIis|SpecifiedPickupDirectory string configures IIS to store e-mails in a file location on disk for later delivery. The variable /SpecifiedPickupDirectory string sets the file location on disk in which to store the e-mail messages for later delivery.

Note that when you use Appcmd.exe to configure theツ<mailSettings>ツelement at the global level in IIS, you must specifyツ/commit:WEBROOTツin the command so that configuration changes are made to the root Web.config file instead of the ApplicationHost.config file.

Edit the Configuration Files

  1. First, configure the Php.ini file. Open theツPhp.iniツfile, and find the entry:

    console
    [mail function]
    
  2. Set the following values:

    console
    SMTP=localhost
    sendmail_from = string
    smtp_port=25
    

    Note that the default value is localhost, so there is no need to change this if SMTP is installed locally.

    • Save and close theツPhp.iniツfile.
  3. Enable Relay for localhost:

    • Open theツInternet Information Services (IIS) 6.0 Manager.
    • Right-click onツDefault SMTP Virtual Server.
  4. On theツPropertiesツpage, open theツAccesstab, and then click onツConnection. You can see which server or IP addresses are allowed to connect to the server.
  5. If the IP address 127.0.0.1 is not listed, add it using theツAddツbutton. You may also add your server IP address to the list.

    Figure 2: Enable Relay for localhost

  6. ClickツOKツto accept the information.
  7. Click theツRelayツbutton on theツAccessツtab, and set up the relay options for the server. Ensure that localhost and the IP address 127.0.0.1 are granted permission to relay mail.
  8. ClickツOKツto accept the options, and then clickツApplyツandツOKツto return to the main page of the IIS Manager.
  9. ClickツRestart IIS.

Test E-Mail from PHP

Create a test script to see whether you can send e-mail using PHP. Copy the following text and save it asツemail_test.phpツat your server root.

XML
<?php
if(mail(窶
 This email address is being protected from spambots. You need JavaScript enabled to view it.
 窶,窶冲est message窶)){
     echo(窶椀k窶);
     }
else{

Run the file atツmydomain.com/email_test.php

Comments   

 
0 #1 Guest 2018-10-05 00:23
Thanks for any other magnificent article. The place else could anybody
get that type of info in such an ideal way of writing?
I have a presentation subsequent week, and I am at the
look for such info.

Also visit my page: minecraft
Quote
 

Articles by Date

TweetTweet Share on LinkedInShare on LinkedIn Share on Google+Google+ Submit to RedditReddit Publish on WordPress WordPress Send emailSend email