-1

How do I send mails using PHP? I'm pretty much confused about what I should do.

What does PhpMailer do? If I have a normal HTML file like this how will I code it to mail?

<div class="mail-grids">
  <div class="col-md-6 mail-grid-left animated wow slideInLeft" data-wow-delay=".5s">
    <form action="#" method="post">
      <input name="Name" onblur="if (this.value == '') {this.value = 'Name';}" onfocus="this.value = '';" required="" type="text" value="Name">
      <input name="Email" onblur="if (this.value == '') {this.value = 'Email';}" onfocus="this.value = '';" required="" type="email" value="Email">
      <input name="Subject" onblur="if (this.value == '') {this.value = 'Subject';}" onfocus="this.value = '';" required="" type="text" value="Subject">
      <textarea name="Message" onblur="if (this.value == '') {this.value = 'Message...';}" onfocus="this.value = '';" required="" type="text">Message...
      </textarea>
      <input type="submit" value="Submit Now" style="margin-left: 378px;">
      </input>
      </input>
      </input>
      </input>
    </form>
  </div>
halfer
  • 19,824
  • 17
  • 99
  • 186
mishal
  • 63
  • 11

1 Answers1

0

There is a in built mail function in PHP.

Syntax is

bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )

For more clarification read this document PHP mail

But if your files are in local computer,(wamp or xamp) using php mail function is quite confusing. Because you have to configure smtp settings. Refer this post for settings : php send mail from localhost.

There you can use PHP mailer. For this there are some well developed tutorials. I am providing some.

https://github.com/PHPMailer/PHPMailer/wiki/Tutorial

https://www.sitepoint.com/sending-emails-php-phpmailer/

Community
  • 1
  • 1
SRIDHARAN
  • 1,196
  • 1
  • 15
  • 35