Jump to content

KathyS88

New Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by KathyS88

  1. Would you please tell me what is the best/recommended hosting ? I live in Israel if this change anything
  2. I did fixed the issue. Thanks all for your support the problem was the host, the right one is: mail.mydomain.com Even Godaddy's guides didn't know this I have tried for weeks and finally resolved.
  3. According to the host you can see here in the attachment and link that it should be localhost, I’ve contacted them about this and they said the same (localhost), I was confused too. here: Link . I also have tried Outgoing server and ports Outgoing server (SMTP):smtpout.secureserver.net SSL Port: 465 or 587 and Unfortunately it didn’t work too.
  4. I'm using Linux (cPanel) plan. can you help me with the code? I'm newbie on PHP
  5. Thanks for your explaination and support I'm so sure about all the SMTP configuration settings, Because this is what Godaddy's agents sent me. I did a mail-tester and got total: 6.9/10 and this is what I've got. is this helpful to get resolve the problem?
  6. I'm still in the testing mode version of my website (it's LIVE on GoDaddy's servers), and apparently I have a problem with the contact page, I try to send an email and I get this message: There was an error while submitting the form. Please try again later. Mailer Error: SMTP Error: Could not connect to SMTP host. I talked to GoDaddy and they checked the server and everything is 100% fine, The SMTP settings are correct too. The e-mail is fine too, it's sending and recieving any other mails. I'm so sure from the code lines, I tried to change it code several times and I didn't find any error on the written lines, please I would appreciate it if you could tell me what I missed? Attached PHP code: <?php // PHP Mailer use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; try { require 'PHPMailer/Exception.php'; require 'PHPMailer/PHPMailer.php'; require 'PHPMailer/SMTP.php'; $mail = new PHPMailer(true); //Server settings //$mail->SMTPDebug = SMTP::DEBUG_SERVER; // Enable verbose debug output $mail->isSMTP(); // Send using SMTP $mail->Host = 'localhost'; // Set the SMTP server to send through $mail->SMTPAuth = false; // Enable SMTP authentication $mail->Username = 'myemail@here.com'; // SMTP username $mail->Password = 'myPasswordHere'; // SMTP password $mail->SMTPSecure = 'None'; // 'ssl' or 'tls' or Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` also accepted $mail->Port = 25; // TCP port to connect to. For Example: 25 - Simple SMTP. 465 - SSL SMTP. 587 - TLS SMTP. //From $mail->setFrom('myemail@here.com', 'Mailer'); // Add your hosting account email or server admin email //Recipient $mail->addAddress('myemail@here.com', 'My Name'); // Add a recipient (your email). Add your name //ReplyTo $mail->addReplyTo($_POST['email'], $_POST['name']); // Do not change this line // Content $mail->isHTML(true); // Set email format to HTML $mail->Subject = 'New message from contact form'; // Email subject. You can change this text $fields = array('name' => 'Name', 'email' => 'Email', 'message' => 'Message'); // array variable name => Text to appear in the email $emailText = nl2br("You have new message from Contact Form\n"); foreach ($_POST as $key => $value) { if (isset($fields[$key])) { $emailText .= nl2br("$fields[$key]: $value\n"); } } $mail->Body = $emailText; $mail->send(); $okMessage = 'Contact form successfully submitted. Thank you, I will get back to you soon!'; // You can change this text (message) $responseArray = array('type' => 'success', 'message' => $okMessage); } catch (Exception $e) { $errorMessage = "There was an error while submitting the form. Please try again later. Mailer Error: {$mail->ErrorInfo}"; // You can change this text (message) $responseArray = array('type' => 'danger', 'message' => $errorMessage); } if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { $encoded = json_encode($responseArray); header('Content-Type: application/json'); echo $encoded; } else { echo $responseArray['message']; }
×
×
  • 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.