serving the solutions day and night


Sunday, December 25, 2011

Send Email in PHP using GMAIL SMTP Server

  1. Download and Unzip: download
  2. Open Sendmail.ini in text editor
    Change the following options Sendmail.ini and save.



  3. Open your PHP configuration (PHP.ini), Edit and Save:
    [mail function]
    ; For Win32 only.
    ;SMTP = localhost

    ;smtp_port = 25

    ; For Win32 only.
    ;sendmail_from =

    ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
    sendmail_path ="C:\DNS\Projects\sendmail\sendmail.exe -t"

    ; Force the addition of the specified parameters to be passed as extra parameters
    ; to the sendmail binary. These parameters will always replace the value of
    ; the 5th parameter to mail(), even in safe mode.
    ;mail.force_extra_parameters =
  1. Download and Install: stunnel-4.54-installer.exe 
  2. In start menu, go to stunnel folder and click on 'Edit stunnel.conf'
    Uncomment the following options stunnel.conf and save.
    debug = 7
    output = stunnel.log

    cert = stunnel.pem

    client = yes
    accept =
    connect =
  3. In start menu, go to stunnel folder and click 'Run stunnel' and Start 'Service Start'.
  4. Option to Configure Sendmail to Stunnel, Go edit sendmail.ini and change to the following:
    smtp_server=localhost and smtp_port=25

1 comment:

Anonymous said...

This Blog is really good thanks for posting it.6 months industrial training in chandigarh