php - Sending Email with Godaddy server -
i have php script can send email in local test environment. using google smtp server that. when use same code send email godaddy server, not getting email.
this php code using
if (empty($errormessage)) { function smtpmailer($to, $from, $from_name, $subject, $body) { global $error; $mail = new phpmailer(); // create new object $mail->issmtp(); // enable smtp $mail->smtpdebug = 2; // debugging: 1 = errors , messages, 2 = messages $mail->smtpauth = true; // authentication enabled $mail->smtpsecure = 'ssl'; // secure transfer enabled required gmail $mail->smtpautotls = false; $mail->dkim_domain = '127.0.0.1'; $mail->debugoutput = 'html'; $mail->host = 'localhost'; $mail->port = 465; $mail->username = guser; $mail->password = gpwd; $mail->setfrom($from, $from_name); $mail->subject = $subject; $mail->body = $body; $mail->addaddress($to); if (!$mail->send()) { //$error = 'mail error: '.$mail->errorinfo; return false; } else { //$error = 'message sent!'; return true; } } if (smtpmailer("testuser@gmail.com", $email, $name, $subject, $message)) { array_push($successmessage, "message send successfully"); } else { array_push($mailerrormessage, "error sending message, please try again"); } }
this error message getting
2017-08-18 08:59:00 server -> client: 235 authentication succeeded 2017-08-18 08:59:00 client -> server: mail from:<sdfsdf@dfdsfds.com> 2017-08-18 08:59:00 server -> client: 250 ok 2017-08-18 08:59:00 client -> server: rcpt to:<testuser@gmail.com> 2017-08-18 08:59:00 server -> client: 250 accepted 2017-08-18 08:59:00 client -> server: data 2017-08-18 08:59:00 server -> client: 354 enter message, ending "." on line 2017-08-18 08:59:00 client -> server: date: fri, 18 aug 2017 08:59:00 +0000 2017-08-18 08:59:00 client -> server: to: testuser@gmail.com 2017-08-18 08:59:00 client -> server: from: sdfdsf <sdfsdf@dfdsfds.com> 2017-08-18 08:59:00 client -> server: subject: sdfdsf 2017-08-18 08:59:00 client -> server: message-id: <07861decb0a3210648608f6e6b5db395@thedomain.com> 2017-08-18 08:59:00 client -> server: x-mailer: phpmailer 5.2.24 (https://github.com/phpmailer/phpmailer) 2017-08-18 08:59:00 client -> server: mime-version: 1.0 2017-08-18 08:59:00 client -> server: content-type: text/plain; charset=iso-8859-1 2017-08-18 08:59:00 client -> server: 2017-08-18 08:59:00 client -> server: dsfdfsf 2017-08-18 08:59:00 client -> server: 2017-08-18 08:59:00 client -> server: . 2017-08-18 08:59:00 server -> client: 250 message denied spoofing attempt via smtp auth (from address: sdfdsf <sdfsdf@dfdsfds.com> ip: 127.0.0.1 authenticatedid: contact@thdeomain.com account owner: theowner) 2017-08-18 08:59:00 client -> server: quit 2017-08-18 08:59:00 server -> client: 221 md-59.webhostbox.net closing connection
i not know if issue phpmailer or mail server
Comments
Post a Comment