Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- date_default_timezone_set('Etc/UTC');
- require 'PHPMailerAutoload.php';
- $mail = new PHPMailer();
- $mail->SMTPDebug = 3;
- $mail->IsSMTP();
- //$mail->IsSMTP();
- $mail->Debugoutput = 'html';
- $mail->Host = 'relay-hosting.secureserver.net';
- $mail->Port = 25;
- $mail->SMTPSecure = false;
- $mail->SMTPAuth = false;
- $mail->Username = "exemple@gmail.com";
- $mail->Password = "password";
- $name = "catarina";
- $email = "myEmail@hotmail.com";
- $message = "test";
- $mail->setFrom($email, $name);
- $mail->addAddress('me@exemple.io');
- $mail->Subject = 'Contact Site';
- $mail->Body = $message;
- //send the message, check for errors
- if (!$mail->send()) {
- echo "Mailer Error: " . $mail->ErrorInfo;
- } else {
- echo "Message sent!";
- }
- function submitForm() {
- $.ajax({type:'POST', url:'email-action.php', data:$('#contact-form').serialize(), success: function(result){
- $('.submit').html('send');
- $('.send').removeClass('no-show');
- $('.send').removeClass('no-show-mobile');
- }});
- };
- <form action="/" onsubmit="return submitForm();" method="post" name="contactform" class="contact-form wow zoomIn" data-wow-delay="0.6s" id="contact-form">
- <div class="col-md-6">
- <div class="row">
- <div class="col-md-12">
- <input placeholder="Name" class="input-field" name="name" required="" type="text">
- </div>
- <div class="col-md-12">
- <input placeholder="E-mail" class="input-field" name="email" required="" type="email">
- </div>
- </div>
- </div>
- <div class="col-md-6">
- <textarea placeholder="Message" class="input-field" name="message"></textarea>
- <input value="Send Message" class="input-send submit" type="submit" name="submit">
- </div>
- <div class="col-md-12 send no-show hidden-xs"><button class=" botao btn btn-sucess"><h4 class="">Message sent sucessfully! We will get in touch shortly.</h4></button></div>
- <div class="col-md-12 send no-show-mobile visible-xs"><button class=" botao btn btn-sucess"><h4 class="">Message sent sucessfully!</h4></button></div>
- </form>
- date_default_timezone_set('Etc/UTC');
- require 'PHPMailerAutoload.php';
- $mail = new PHPMailer();
- $mail->SMTPDebug = 3;
- $mail->IsSMTP();
- //$mail->IsSMTP();
- $mail->Debugoutput = 'html';
- $mail->Host = 'relay-hosting.secureserver.net';
- $mail->Port = 25;
- $mail->SMTPSecure = false;
- $mail->SMTPAuth = false;
- $mail->Username = "exemple@gmail.com";
- $mail->Password = "password";
- ///this is the thing that change for one script to another
- $name = strip_tags($_POST['name']);
- $email = strip_tags($_POST['email']);
- $message = strip_tags($_POST['message']);
- /////
- $mail->setFrom($email, $name);
- $mail->addAddress('me@exemple.io');
- $mail->Subject = 'Contact Site';
- $mail->Body = $message;
- //send the message, check for errors
- if (!$mail->send()) {
- echo "Mailer Error: " . $mail->ErrorInfo;
- } else {
- echo "Message sent!";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement