-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHPMailer not sending mail #2005
Comments
domain doesn`t exist (mail.company.in: Non-existent domain), if mail server is in your localhost, try using localhost, also for all information's you have link in exception: P.S. Reduct/remove password, don`t ever send your password (credentials). |
You're doing a whole load of things wrong, but the fundamental thing is that your server does not support encryption. That's bad. As for the other things:
This means you're using a very old version. Upgrade.
There is no debug level 6. You only need 2 to diagnose this problem.
You're disabling authentication (so the
Don't do this; it's dangerous. Fix your server instead.
You don't need to set this.
Your'e trying to undo things that PHPMailer is doing for you; don't do this as it will likely break your messages. Your'e already calling
WordWrap is not the same thing as line length, and only applies to plain text messages. You don't need this, and it's not doing what you think anyway.
Don't check for errors like this. Check the return vale of |
i just use dummy domains with dummy user id password |
I can't able to send mail using phpmailer from windows server 2012 , but i can able to send from local machine using local server. Can any body help me?
require("PHPMailer/PHPMailerAutoload.php");
$Mail = new PHPMailer();
$Mail->IsSMTP(); // Use SMTP
$Mail->Host = "mail.company.in";
$Mail->Port = 25;
$Mail->SMTPDebug = 6; // 2 to enable SMTP debug information
$Mail->SMTPAuth = false; // enable SMTP authentication
$Mail->AuthType = 'PLAIN'; // enable SMTP authentication
$Mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
$Mail->Username = "noreply.company";
$Mail->Password = "456546";
$Mail->Priority = 1; // Highest priority - Email priority (1 = High, 3 = Normal, 5 = low)
$Mail->CharSet = 'UTF-8';
$Mail->Encoding = '8bit';
$Mail->Subject = 'Test Email Using Gmail';
$Mail->ContentType = 'text/html; charset=utf-8\r\n';
$Mail->From = '[email protected]';
$Mail->FromName = 'Test';
$Mail->WordWrap = 900; // RFC 2822 Compliant for Max 998 characters per line
$Mail->AddAddress( $to ); // To:
$Mail->isHTML( TRUE );
$Mail->Body = $content;
$Mail->AltBody = $content;
$Mail->Send();
$Mail->SmtpClose();
if ( $Mail->IsError() ) { // ADDED - This error checking was missing
return FALSE;
}
else {
return TRUE;
}
I got the following error message,
2020-03-05 08:51:24 SERVER -> CLIENT: 220 company.in ESMTP Postfix
2020-03-05 08:51:24 CLIENT -> SERVER: EHLO 59.145.185.21
2020-03-05 08:51:24 SERVER -> CLIENT: 250-company.in 250-PIPELINING250-SIZE 92274688250-VRFY250-ETRN250-ENHANCEDSTATUSCODES250-8BITMIME250 DSN
2020-03-05 08:51:24 CLIENT -> SERVER: STARTTLS
2020-03-05 08:51:24 SERVER -> CLIENT: 502 Command not implemented
2020-03-05 08:51:24 SMTP ERROR: STARTTLS command failed: 502 Command not implemented
SMTP Error: Could not connect to SMTP host.
2020-03-05 08:51:24 CLIENT -> SERVER: QUIT
2020-03-05 08:51:24 SERVER -> CLIENT: 221 2.0.0 Bye
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
The text was updated successfully, but these errors were encountered: