Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>PHP's mail() function doesn't implement SMTP protocol directly. Instead it relies on sendmail() MTA (SMTP server), or a replacement like postfix or mstmp. It works fine on Unix as long as MTA installed.</p> <p>On Windows (from PHP.net manual):</p> <blockquote> <p>The Windows implementation of mail() differs in many ways from the Unix implementation. First, it doesn't use a local binary for composing messages but only operates on direct sockets which means a MTA is needed listening on a network socket (which can either on the localhost or a remote machine).</p> </blockquote> <p>So - the moral of the story - you need to install mail server.</p> <p>However - if it's for test purpose only - simply get a PHP library that actually implements SMTP protocol and use your regular gmail email address to send emails:</p> <p>Instead of using PHP's mail() use one of these:</p> <ol> <li>PHPmailer</li> <li>SwiftMailer</li> <li>Zend\Mail</li> </ol> <p>These PHP libraries actually implement SMTP protocol so one can easily send emails from any platform, without email server installed on the same machine:</p> <p>PHPMAILER example: </p> <pre><code>$mail-&gt;IsSMTP(); // telling the class to use SMTP $mail-&gt;Host = "stmp.gmail.com"; // SMTP server $mail-&gt;SMTPDebug = 1; // enables SMTP debug information (for testing) // 1 = errors and messages // 2 = messages only $mail-&gt;SMTPAuth = true; // enable SMTP authentication $mail-&gt;SMTPSecure = "ssl"; // sets the prefix to the servier $mail-&gt;Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server $mail-&gt;Port = 465; // set the SMTP port for the GMAIL server $mail-&gt;Username = "some_email@gmail.com"; // GMAIL username $mail-&gt;Password = "pass111"; // GMAIL password $mail-&gt;SetFrom('some_email@gmail.com', 'My name is slim shady'); $mail-&gt;AddReplyTo("some_email@gmail.com","My name is slim shady"); $mail-&gt;Subject = "Hey, check out http://www.site.com"; $mail-&gt;AltBody = "Hey, check out this new post on www.site.com"; // optional, comment out and test $mail-&gt;MsgHTML($body); $address = "some_email@gmail.com"; $mail-&gt;AddAddress($address, "My name is slim shady"); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload