<section id="contact" class="contact mt-5">
    <div class="section-title mt-5 ml-5" data-aos="zoom-out">
        <h2>Contact</h2>
        <p>Contact</p>
    </div>

    <div data-aos="fade-up">
        <iframe style="border:0; width: 100%; height: 300px;" src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3989.810013097138!2d100.53242711426975!3d-0.11692023550004788!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x2fd55229288ae08f%3A0x5e9f21acedf350c8!2sSMK%20NEGERI%202%20KEC.GUGUAK!5e0!3m2!1sid!2sid!4v1598407194524!5m2!1sid!2sid" width="600" height="450" frameborder="0" style="border:0;" allowfullscreen="" aria-hidden="false" tabindex="0"></iframe>
    </div>

    <div class="container" data-aos="fade-up">

        <div class="row mt-5">

            <div class="col-lg-4">
                <div class="info">
                    <div class="address">
                        <i class="icofont-google-map"></i>
                        <h4>Alamat:</h4>
                        <p> Jl.Tuanku Nan Biru Ampang Gadang VII Koto Talago Kec.Guguak, Payakumbuh, 26253, West Sumatra</p>
                    </div>

                    <div class="email">
                        <i class="icofont-envelope"></i>
                        <h4>Email:</h4>
                        <p>www.smkn2guguak.sch.id</p>
                    </div>

                    <div class="phone">
                        <i class="icofont-phone"></i>
                        <h4>Call:</h4>
                        <p>(0752) 97318</p>
                    </div>

                </div>

            </div>

            <div class="col-lg-8 mt-5 mt-lg-0">

                <?php
                if (isset($_POST['kirim'])) {

                    require 'PHPMailer/PHPMailerAutoload.php';
                    $email_pengirim = "percobaanemail801@gmail.com";
                    $isi = $_POST['isi'];
                    $subjek = $_POST['subjek'];
                    $email_tujuan = $_POST['email_tujuan'];

                    $mail = new PHPMailer();

                    $mail->IsHTML(true);    // set email format to HTML
                    $mail->IsSMTP();   // we are going to use SMTP
                    $mail->SMTPAuth   = true; // enabled SMTP authentication
                    $mail->SMTPSecure = "ssl";  // prefix for secure protocol to connect to the server
                    $mail->Host       = "smtp.gmail.com";      // setting GMail as our SMTP server
                    $mail->Port       = 465;                   // SMTP port to connect to GMail
                    $mail->Username   = $email_pengirim;  // alamat email kamu
                    $mail->Password   = "percobaan12";            // password GMail
                    $mail->SetFrom($email_pengirim, 'noreply');  //Siapa yg mengirim email
                    $mail->Subject    = $subjek;
                    $mail->Body       = $isi;
                    $mail->AddAddress($email_tujuan);

                    if (!$mail->Send()) {
                        echo "Eror: " . $mail->ErrorInfo;
                        exit;
                    } else {
                        echo "<div class='alert alert-success'><strong>Berhasil!</strong> Email telah berhasil dikirim.</div>";
                    }
                }
                ?>
                <br>
                <form action="" method="post">
                    <div class="form-group">
                        <input class="form-control" name="email_tujuan" placeholder="Email Tujuan:">
                    </div>
                    <div class="form-group">
                        <input class="form-control" name="subjek" placeholder="Subjek:">
                    </div>
                    <div class="form-group">
                        <textarea id="compose-textarea" name="isi" class="form-control" style="height: 300px" placeholder="Isi Email"></textarea>
                    </div>

                    <button type="submit" name="kirim" class="btn btn-primary">Kirim</button>

                </form>

            </div>

        </div>

    </div>
</section>