Jump to content

whitt

Members
  • Content Count

    44
  • Joined

  • Last visited

Community Reputation

0 Neutral

About whitt

  • Rank
    Member
  1. okk i think the issue is my ajax url i have the form working then the php file is in the same directory but not when in the bin folder form.zip
  2. I just checked the JS console i have this POST http://localhost/contact_form/bin/contact_me.php 500 (Internal Server Error)
  3. Am i close to fixing this at least?
  4. How do you mean return true all the time?
  5. <?php // check if fields passed are empty if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['phone']) || empty($_POST['message']) || !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL)) { echo "No arguments Provided!"; return false; } $name = $_POST['name']; $email_address = $_POST['email']; $message = $_POST['message']; $phone = $_POST['phone']; // create email body and send it $to = 'email@gmail.com'; // put your email $email_subject = "Contact form submitted by: $name"; $email_body = "You have received a new message. \n\n". " Here are the details:\n \nName: $name \n ". "Email: $email_address\n Phone: $phone\n Message \n $message"; $headers = "From: whitegatescattery.com\n"; $headers .= "Reply-To: email@gmail.com"; mail($to,$email_subject,$email_body,$headers); return true; ?> This worked with Gmail i dont get why this <?php require_once './libPHPMailerAutoload.php'; // check if fields passed are empty // check if fields passed are empty $name = $_POST['name']; $email_address = $_POST['email']; $message = $_POST['message']; $phone = $_POST['phone']; if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['phone']) || empty($_POST['message']) || !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL)) { echo "No arguments Provided!"; return false; } $mail = new PHPMailer; $mail->isSMTP(); $mail->SMTPAuth= true; $mail->SMTPDebug = 1; $mail->Host = 'smtp-mail.outlook.com'; $mail->Username = 'email'; $mail->Password = 'pass'; $mail->SMTPSecure = 'tls'; $mail->Port = 587; $mail->From = $email_address; $mail->FromName = $name; $mail->addReplyTo('reply@outlook.com','reply'); $mail->addAddress('@outlook.com','me'); $mail->isHTML(true); $mail->Subject = "Contact Form has been submitted"; $mail->Body = "You have received a new message. <br><br>". " Here are the details:<br> Name: $name <br> Phone Number: $phone <br>". "Email: $email_address<br> Message <br> $message"; var_dump($mail->send()); return true; ?> Is causing my ajax to append my fail message
  6. I may have used the wrong terminology but i don't know why the form is not working
  7. Can someone have a look at this , if i take the php code below the return false it says the message is sent. contact_form.zip
  8. <?php require_once 'PHPMailerAutoload.php'; // check if fields passed are empty if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['message']) || !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL)) { echo "No arguments Provided!"; } $name = $_POST['name']; $email_address = $_POST['email']; $message = $_POST['message']; $mail = new PHPMailer; $mail->isSMTP(); $mail->SMTPAuth= true; $mail->SMTPDebug = 1; $mail->Host = 'smtp-mail.outlook.com'; $mail->Username = 'email'; $mail->Password = 'pass'; $mail->SMTPSecure = 'tls'; $mail->Port = 587; $mail->From = $email_address; $mail->FromName = $name; $mail->addReplyTo('reply@outlook.com','reply'); $mail->addAddress('testytestersontesting@outlook.com','Testy Testerson'); $mail->isHTML(true); $mail->Subject = "Contact Form has been submitted"; $mail->Body = "You have received a new message. <br><br>". " Here are the details:<br> Name: $name <br> Phone Number: $phone <br>". "Email: $email_address<br> Message <br> $message"; echo var_dump($mail->send()); return true; ?> I just flat out cannot see why this does not work , the script on its own works but when i try to integrate it into the form i get my ajax sending back my error alert.
  9. Ok so i just made a test email address testy testerson , i an send emails from the testy account to my email account , i literally changed no code.
  10. Thing is this was working fine like 10 minutes ago i managed to send like 8 emails.
  11. i have to use outlook as its what my mate wants to use for this form
  12. If my AJAX is working it has to be on the PHP end
  13. Literally 5 minutes later and i get this " 2015-03-06 11:59:37 CLIENT -> SERVER: EHLO localhost 2015-03-06 11:59:37 CLIENT -> SERVER: STARTTLS 2015-03-06 11:59:37 CLIENT -> SERVER: EHLO localhost 2015-03-06 11:59:38 CLIENT -> SERVER: AUTH LOGIN 2015-03-06 11:59:38 CLIENT -> SERVER: bWF0dGhld3B3aGl0dGluZ3RvbkBvdXRsb29rLmNvbQ== 2015-03-06 11:59:38 CLIENT -> SERVER: TWF2ZXJpY2s4OQ== 2015-03-06 11:59:39 CLIENT -> SERVER: MAIL FROM: 2015-03-06 11:59:39 CLIENT -> SERVER: RCPT TO: 2015-03-06 11:59:39 CLIENT -> SERVER: DATA 2015-03-06 11:59:39 CLIENT -> SERVER: Date: Fri, 6 Mar 2015 11:59:37 +0000 2015-03-06 11:59:39 CLIENT -> SERVER: To: Matthew Whittington 2015-03-06 11:59:39 CLIENT -> SERVER: From: matthewpwhittington@outlook.com 2015-03-06 11:59:39 CLIENT -> SERVER: Reply-To: sender 2015-03-06 11:59:39 CLIENT -> SERVER: Subject: Testing Email 2015-03-06 11:59:39 CLIENT -> SERVER: Message-ID: <26e958edff522d3f6a43f03aaf8bab81@localhost> 2015-03-06 11:59:39 CLIENT -> SERVER: X-Priority: 3 2015-03-06 11:59:39 CLIENT -> SERVER: X-Mailer: PHPMailer 5.2.9 (https://github.com/PHPMailer/PHPMailer/) 2015-03-06 11:59:39 CLIENT -> SERVER: MIME-Version: 1.0 2015-03-06 11:59:39 CLIENT -> SERVER: Content-Type: multipart/alternative; 2015-03-06 11:59:39 CLIENT -> SERVER: boundary="b1_26e958edff522d3f6a43f03aaf8bab81" 2015-03-06 11:59:39 CLIENT -> SERVER: Content-Transfer-Encoding: 8bit 2015-03-06 11:59:39 CLIENT -> SERVER: 2015-03-06 11:59:39 CLIENT -> SERVER: --b1_26e958edff522d3f6a43f03aaf8bab81 2015-03-06 11:59:39 CLIENT -> SERVER: Content-Type: text/plain; charset=us-ascii 2015-03-06 11:59:39 CLIENT -> SERVER: 2015-03-06 11:59:39 CLIENT -> SERVER: This is a Test Email 2015-03-06 11:59:39 CLIENT -> SERVER: 2015-03-06 11:59:39 CLIENT -> SERVER: 2015-03-06 11:59:39 CLIENT -> SERVER: --b1_26e958edff522d3f6a43f03aaf8bab81 2015-03-06 11:59:39 CLIENT -> SERVER: Content-Type: text/html; charset=us-ascii 2015-03-06 11:59:39 CLIENT -> SERVER: 2015-03-06 11:59:39 CLIENT -> SERVER: This is a Test Email ssl 2015-03-06 11:59:39 CLIENT -> SERVER: 2015-03-06 11:59:39 CLIENT -> SERVER: 2015-03-06 11:59:39 CLIENT -> SERVER: 2015-03-06 11:59:39 CLIENT -> SERVER: --b1_26e958edff522d3f6a43f03aaf8bab81-- 2015-03-06 11:59:39 CLIENT -> SERVER: 2015-03-06 11:59:39 CLIENT -> SERVER: . 2015-03-06 11:59:40 SMTP ERROR: DATA END command failed: 550 5.3.4 Requested action not taken; To continue sending messages, please sign in to your account. 2015-03-06 11:59:40 SMTP Error: data not accepted. bool(false) 2015-03-06 11:59:40 CLIENT -> SERVER: QUIT 2015-03-06 11:59:40 SMTP ERROR: QUIT command failed:" @outlook.com>@outlook.com>@outlook.com>@outlook.com>
  14. I did a basic just send an email PHP scrip i have the emails going to my in box with this <?php require_once 'PHPMailerAutoload.php'; $mail = new PHPMailer; $mail->isSMTP(); $mail->SMTPAuth= true; $mail->Host = 'smtp-mail.outlook.com'; $mail->Username = 'myemail@outlook.com'; $mail->Password = 'pass'; $mail->SMTPSecure = 'tls'; $mail->Port = 587; $mail->From = 'sender@outlook.com'; $mail->FromName = $name; $mail->addReplyTo('sender@outlook.com',$name); $mail->addAddress('myemail@outlook.com',me); $mail->Subject = 'Testing Email'; $mail->Body = 'This is a Test Email ssl'; $mail->AltBody ='This is a Test Email'; var_dump($mail->send()); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.