How to send email via PHP code on Windows server

Collapse

Unconfigured Ad Widget

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Shane
    Senior Member
    • Jun 2006
    • 264

    How to send email via PHP code on Windows server

    Hello All,

    One can send email via PHP code on windows server. Please refer below mentioned sample script of PHP Mail:

    <?php

    $to = 'To Email account';
    $from = 'From Email account';
    $subject = 'Subject line of the message';

    $headers = 'From: From email account' "\r\n".
    'Reply-To: Reply to email account'. "\r\n".
    'Return-Path: Return path email account.' "\r\n".
    'X-Mailer: PHP/' . phpversion();
    $message = "Message of the email body section";

    mail ($to, $subject, $message, $headers, "-f $from");

    ?>

    Thanks,

    Shane G.
    AccuWebHosting.Com
    Last edited by admin; 08-05-2015, 07:45 AM.
Working...
X