June 6, 201115 yr Hi, Still not had much luck getting my contact form working over at my portfolio My site I have some AJAX which sends the input to a php page (process.php) but how can i then send it to my gmail account. Iv been trying PHPMailer but still not having alot of luck with that Heres the Ajax $(function() { $("#contact_form").submit(function() { var name = $("input#name").val(); var email = $("input#email").val(); var phone = $("input#phone").val(); var reason = $("input#contact_reason").val(); var message = $("input#message").val(); var dataString = 'name='+ name + '&email=' + email + '&phone=' + phone + '&reason=' + reason + '&message=' + message; $.ajax({ type: "POST", url: "/wp-content/themes/Portfolio/js/process.php", data: dataString, success: function() { $('#contact_form').html("<div id='message'></div>"); $('#message').html("<h2 class='no-margin-title'>Contact Form Submitted!</h2>"); $('#message').append("<img id='contact-tick' src='/wp-content/themes/Portfolio/images/tick.gif'/>") .append("<h3>I will be in touch <span class='blog-sub-span'>soon</span></h3>") .hide() .fadeIn(1500, function() { }); } }); return false; }); }); What do i need to do in the process.php page to send it over to my gmail? Thanks for any help
June 6, 201115 yr Author Hmm still not working, i currently have this in the process.php page as a test <html> <body> <?php if (isset($_REQUEST['email'])) //if "email" is filled out, send email { //send email $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; mail("ben.gibson.2011@gmail.com", "Testing", $message, "From:" . $email); } ?> </body> </html> But im not getting anything in my gmail even in the spam folder
June 6, 201115 yr Your host may not allow the PHP mail() function to be used as it does not require any authentication. Try using just PHPMailer and setting it up with SMTP authentication. You could also try this: http://www.dotvoid.com/2007/04/problem-sending-mail-with-php-mail-function/ Also, you posted this thread twice which makes it more difficult for people to help you consistently. Edited June 6, 201115 yr by Moose
Create an account or sign in to comment