Ошибки при подключении почты и отправке сообщений
Содержание:
- Ошибки при подключении почты
- Ошибки при отправке сообщений
Ошибки при подключении почты
При сохранении почтового канала при внешнем типе соединения (imap/smtp) Юздеск производит попытку соединения. Если попытка оказывается неудачной, система выводит красную плашку с номером ошибки:
Возможные ошибки:
- Ошибка 101: Сервер не отвечает или недоступен.
- Ошибка 111: Не получается установить соединение по протоколу SMTP.
- Ошибка 420: Сервер не отвечает или недоступен. Сервер долго не отвечает при запросе.
- Ошибка 422: Почтовый ящик получателя переполнен.
- Ошибка 441: Почтовый сервер получателя не отвечает.
- Ошибка 450: Почтовый сервер получателя не отвечает. По какой-то причине недоступен почтовый сервер получателя. Возможно, он не существует.
- Ошибка 500: Почтовый сервер получателя не отвечает. Ошибка возникает, когда почтовый сервер не понимает запрос из-за разных операционных систем, либо допущена ошибка в запросе.
- Ошибка 510: Некорректный адрес получателя.
- Ошибка 512: Домен получателя не существует.
- Ошибка 530: Неверный логин или пароль. Неверный логин или пароль, либо пользователю не выданы нужные права доступа.
Ошибки при отправке сообщений
При ошибке отправки сообщения оно станет внутренним комментарием на красном фоне. В правом верхнем углу появится сообщение об ошибке — оно либо пояснит причину ошибки, либо предложит написать нам в поддержку для решения вопроса. Возможные типы ошибок:
- Не удалось отправить сообщение. Пожалуйста, напишите нам на support@usedesk.ru;
- Неверный адрес отправителя. Пожалуйста, проверьте, нет ли ошибки в почтовом адресе отправителя;
- Неверный адрес получателя. Пожалуйста, проверьте, нет ли ошибки в почтовом адресе получателя;
- Ошибка при обработке текста сообщения. Пожалуйста, напишите нам на support@usedesk.ru;
- Неверный адрес получателя в копии. Пожалуйста, проверьте, нет ли ошибки в почтовом адресе получателя;
- Неверный адрес получателя в скрытой копии. Пожалуйста, проверьте, нет ли ошибки в почтовом адресе получателя;
- Превышено максимально допустимое число отправок microsoft graph, попробуйте позднее. Подробнее о лимитах — по ссылке.
I need help please
this is my code:
require 'PHPMailerAutoload.php';
$mail = new PHPMailer;
$mail->isSMTP();
$mail->Host = "smtp.gmail.com";
$mail->SMTPDebug = 2;
$mail->SMTPAuth = true;
$mail->SMTPSecure = "tls";
$mail->Port = 587;
$mail->Username = 'some@gmail.com';
$mail->Password = 'somepass';
$mail->addAddress('another@gmail.com', 'Josh Adams');
$mail->Subject = 'PHPMailer GMail SMTP test';
$body = 'This is the HTML message body in bold!';
$mail->MsgHTML($body);
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
and I get this error:
2013-12-11 15:15:02 SMTP ERROR: Failed to connect to server: Network is unreachable (101) SMTP connect() failed. Mailer Error: SMTP connect() failed.
any help please?
asked Dec 11, 2013 at 15:35
You might want to start by isolating this problem to determine whether it’s truly a network problem; or whether it’s specific to PHP mailer or your code. On your server, from a command prompt, try using telnet to connect to smtp.gmail.com on port 587, like so:
telnet smtp.gmail.com 587
You should see a response from smtp.gmail.com, like so:
Trying 173.194.74.108...
Connected to gmail-smtp-msa.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP f19sm71757226qaq.12 - gsmtp
Do you see this, or does the connection attempt hang and eventually time out? If the connection fails, it could mean that your hosting company is blocking outgoing SMTP connections on port 587.
answered Dec 12, 2013 at 14:04
mti2935mti2935
11.3k3 gold badges28 silver badges33 bronze badges
1
This worked for me:
change:
$mail->SMTPSecure = 'ssl';
$mail->Host = 'smtp.gmail.com';
$mail->Port = '465';
to
$mail->SMTPSecure = 'tls';
$mail->Host = 'smtp.gmail.com';
$mail->Port = '587';
answered Feb 15, 2020 at 12:54
yayayaya
7,5051 gold badge39 silver badges37 bronze badges
The code below:
$mail->SMTPSecure = 'ssl';
$mail->Host = 'smtp.gmail.com';
$mail->Port = 465;
$mail->Host = 'ssl://smtp.gmail.com:465';
Al Foиce ѫ
4,14512 gold badges39 silver badges49 bronze badges
answered Sep 12, 2019 at 19:56
I was facing the same issues on Godaddy hosting so I spend lots of time and fix it by disabling the SMTP restriction on the server end.
SMTP code is for PHPMailer
$mail = new PHPMailer(true);
try {
//Server settings
//$mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output
$mail->SMTPDebug = 2; //Enable verbose debug output
//$mail->isSMTP(); //Send using SMTP
$mail->Host = "tls://smtp.gmail.com";
$mail->SMTPAuth = true;
$mail->Username = contact@example.in;
$mail->Password = SMTP_PASSWORD;
$mail->SMTPSecure = "tls";
$mail->Port = 587;
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
//Recipients
$mail->setFrom('contact@example.in', 'Online Order');
$mail->addAddress('test@gmail.com'); //Add a recipient
$mail->addReplyTo('contact@example.in', 'Jewellery');
//Attachments
//$mail->addAttachment('/var/tmp/file.tar.gz'); //Add attachments
//$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); //Optional name
//Content
$mail->isHTML(true); //Set email format to HTML
$mail->Subject = 'Order';
$mail->Body = 'This is test email content';
$mail->AltBody = 'This is test email content';
if($mail->send()){
return '1';
}else{
return 'Order email sending failed';
}
answered Feb 18, 2022 at 17:36
kantsvermakantsverma
5871 gold badge10 silver badges31 bronze badges
change
$mail->SMTPSecure = "tls";
with
$mail->SMTPSecure = 'ssl';
Tom Tom
3,6805 gold badges34 silver badges40 bronze badges
answered Jul 1, 2014 at 16:03
1
What’s Causing This Error
The SMTP 101 error can occur when there is a configuration issue with your SMTP settings. It can be:
- A Misconfigured port.
- An invalid SMTP host server.
- An invalid SMTP IP address.
- Invalid use of SSL or TLS.
However, this error commonly occurs with Google SMTP due to invalid SSL or TLS configurations.
Solution — Here’s How To Resolve It
To resolve the error, re-look at your configurations, cross-check them with the configurations provided by the SMTP server’s documentation, and ensure that you’ve configured them correctly.
Using Google SMTP, you could try the configurations shown below to resolve your error. First, however, you must enable «Less Secure Sign-In Technology» for your Google account.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Gmail SMTP server address: smtp.gmail.com Gmail SMTP username: <YOUR-GMAIL-ACCOUNT> (enable less secure apps access) Gmail SMTP password: <YOUR-GMAIL-PASSWORD> Gmail SMTP port (TLS): 587 // for TLS Security Gmail SMTP port (SSL): 465 // for SSL security Requires SSL: Yes // use only with PORT 587 (if error) Requires TLS: Yes // use only with PORT 465 (if error) Requires authentication: Yes // enable authentication. Requires secure connection: Yes // specify to enable SSL/TLS when sending the email.
Home » SMTP Response Codes » The Complete SMTP Error Codes List: Understanding Why That Error Happened & How to Fix It 101
141 Views
Introduction: What is an SMTP Error?
SMTP is an acronym for Simple Mail Transfer Protocol. It is a protocol for sending email messages between servers. SMTP error codes generally mean that there was a problem with the SMTP server or the mail client.
The following table shows the complete SMTP errors and their codes. Unless otherwise mentioned, these error codes are defined in RFC 5322.
How to Troubleshoot Common SMTP Error codes
A mail server is a computer that handles incoming and outgoing email messages, translating them into a standard format, such as SMTP. If you are experiencing an issue with your email account, the first thing you should do is troubleshoot the problem.
The most common causes of SMTP errors are:
– A firewall may be blocking access to port 25.
– The sender’s ISP or email service provider may be blocking port 25.
– The sender’s ISP or email service provider may not allow connections from outside their network.
SMTP Errors & Solutions for Sending Emails
To fix these issues, you need to contact your ISP and ask them to allow outgoing SMTP traffic on port 25. This will solve the problem for most people. If not, then you should contact your hosting provider or email service provider and ask them to whitelist your IP address so that they can send emails from your domain.
Disclaimer: Here, you likely will not be able to open the outgoing SMTP traffic on port 25 on Amazon EC2 instances. The support team will reject your request unless you will give very reinsuring info and a study case about your Port 25 usage on your instance, they will ask you to open a request on Amazon SES Service instead.
SMTP Connection Errors – What you Need to Know and How to Fix Them
The SMTP protocol is the standard way to send emails. It is used by most email clients and servers. Out of the many possible problems, one of the most common ones is connection errors.
Connection errors can be caused by many different factors such as a firewall blocking port 25, an outdated version of the mail server software, or a misconfigured DNS server.
What you need to know:
- Connection problems with mail servers can lead to timeouts and delays in sending emails.
- A firewall blocking port 25 will prevent connections from being made on port 25 which are needed for SMTP authentication and encryption.
- An outdated version of mail server software could cause connection errors due to bugs in it that have been fixed in newer versions.
- Misconfigured DNS servers can cause connection errors when they cannot resolve hostnames correctly for connecting to mail servers or if they cannot find MX records for a domain name which are required for sending email messages through them.
And below you can find the full list of all SMTP Error Codes list, with a short explanation of every type of error.
Codes Meaning And How To Solve
SMTP Server Error 554
Frequency: Common
Importance: Medium
Type: Connectivity / Spam Mark
The SMTP error 554 means that the sending request has failed. It’s a permanent error and probably one of the most common as well, and the email server will not try to send the message again because it’s considered a bounce. The incoming server “thinks” that the sender is spam or that his IP is somehow blacklisted by spam radars.
What you should do if you encountered this error
If you’re using your Google account to send emails, the message might have been filtered as spam. If you’re using a third-party account, the email might not be going through.
Make sure you’ve checked for any typos in your password and try again.
SMTP Error 553
Frequency: Common
Importance: High
Type: Email Validity
This error means that the “Requested action is not taken and probably that the Mailbox is invalid”. Thus, there’s an incorrect email address in the recipient’s list. The most common is a mistyping error.
What you should do if you encountered this error
You should check your email list with an email address validator. We highly recommend SMTPing email validation tool in this case
SMTP Error 552
Frequency: Frequent
Importance: Medium
Type: Connectivity
This error means that the “Requested mail actions are aborted or they exceeded the storage allocation”.
What you should do if you encountered this error
For that, simply put, the bounced recipient’s mailbox has exceeded its limits in another queue and try to send a lighter message or to delete or compress your attachment: it happens often when emails are sent with big attachments.
SMTP Error 551
Frequency: Rare
Importance: Medium
Type: Connectivity / Email Validity
This error means that the “User not local or invalid address and that the Relay is denied”. This means, if your address and the recipient’s address are not local to the server, a relay should be interrupted.
What you should do if you encountered this error
You should contact your ISP (Internet Service Provider) and ask them to either whitelist you or allow you as a trusted sender. Normally, with a professional SMTP provider, you shouldn’t have this issue.
SMTP Error 550
Frequency: Common
Importance: High
Type: Email Validity
This error means that a non-existent email address has been spotted on the remote side. It can be a firewall answer or when the incoming server is down. 550 errors are most likely a non-existent recipient email address.
What you should do if you encountered this error
You should check your email list with an email address validator. We highly recommend SMTPing in this case
SMTP Error 541
Frequency: Common
Importance: High
Type: Email Validity
This error means that the recipient’s address rejected your message due to an anti-spam filter signal. Simply your content has been marked as spam
What you should do if you encountered this error
- Delete your recipient -if it’s not done- from your mailing list
- Verify your email list with a mail list validator that has the feature “complainer”. We highly recommend smtping.com in this case.
- If you forgot to put an unsubscribe link and an unsubscribe tag on the bottom list, don’t forget to put one according to your email-sending platform. You can pick the right unsubscribe tag or link buy clicking here
SMTP Error 530
Frequency: Rare
Importance: High
Type: Authentication
This error means that there is an authentication problem. Less often, it’s the recipient’s server that is blacklisting yours, or simply an invalid email address.
What you should do if you encountered this error
Configure your authentication settings by providing the correct username and password. You have also to be sure of the right Port (either 25, 25xx, 465, or 587).
The next step, send, and if the error persists, you have to check your email list and whether you’ve been blacklisted or not. For this last step, We highly recommend using smtping.com in this case.
SMTP Error 523
Frequency: Common
Importance: Medium
Type: Email Size
This error means that the total size of your email content or template exceeds the incoming server’s limits.
What you should do if you encountered this error
Send again your email splitting your email list into smaller batches. Or you can reduce the sending hourly limit if you are on a self-hosted Email Marketing Application
SMTP Error 513
Frequency: Common
Importance: High
Type: Connectivity/Authentication/Email Validity
This error means that the “Address type is incorrect”, it’s either a mistyping error or an email address format error. Sometimes, it’s more an email authentication issue, an interrupted authentication handshake.
What you should do if you encountered this error
Verify your email list with a mail list validator that has the feature “syntactic”. We highly recommend smtping.com in this case. If it’s done and the error persists, it’s certainly caused by an authentication issue.
SMTP Error 512
Frequency: Frequent
Importance: High
Type: Connectivity
This error means that A DNS error has occurred and the recipient’s domain name host server is non-existent.
What you should do if you encountered this error
Again, verify your email list with a mail list validator that has the feature “EHLO”. We highly recommend smtping.com in this case
Example: name@domain.con or name@domain.xom
SMTP Error 510/511
Frequency: Common
Importance: High
Type: Syntactic
This error means that the sender sent to a bad address.
What you should do if you encountered this error
Again, verify your email list with a mail list validator that has the feature “syntactic”. We highly recommend smtping.com in this case. If it’s done and the error persists, it’s certainly caused by an authentication issue.
SMTP Error 504
Frequency: Rare
Importance: High
Type: Connectivity
This error means that a command parameter is not well-implemented. Like SMTP error 502, if an SMTP command parameter is not well-configured into the Message Transfer Agent parameters, it’s possible that you encounter this type of error.
What you should do if you encountered this error
You have to contact your provider.
SMTP Error 503
Frequency: Frequent
Importance: Medium
Type: Authentication / Connectivity
This error means that you have entered the wrong sequence of commands. This is because the server has either been disconnected or you need to provide your credentials and re-enter them.
What you should do if you encountered this error
Enter your username and password if authentication is needed. Check the type of authentication of your email as well (TLS/SSL, etc..)
SMTP Error 502
Frequency: Rare
Importance: High
Type: Connectivity
Like Error 504, this error means that the command is not configured yet or it has not been activated yet on your own server.
What you should do if you encountered this error
You can activate the debug mode or simply you can contact your provider for further investigation.
SMTP Error 501
Frequency: Rare
Importance: High
Type: Syntactic
This error is another syntactic error, not in the command but in its parameters or arguments. Most of the time it’s because of an invalid address, but it can be because of connection issues as well.
What you should do if you encountered this error
Again, verify your email list with a mail list validator that has the feature “syntactic”. We highly recommend smtping.com in this case.
SMTP Error 500 SMTP
Frequency: Rare
Importance: High
Type: Syntactic
This error means that a syntax error is encountered. The server simply couldn’t recognize the command because of a bad handshake between the server and your firewall or antivirus.
What you should do if you encountered this error
- Read carefully their instructions to solve it.
- Deactivate your firewall or antivirus, you can ask your provider to do so if you are not able to do it
SMTP Error 471
Frequency: Common
Importance: High
Type: Spam Mark
This error means that an error is coming from your mail server. Generally, it’s because of a local anti-spam filter.
What you should do if you encountered this error
- Try to check the log of your MTA
- Contact your Email Marketing Platform or your SMTP service provider to fix the situation.
SMTP Error 452
Frequency: Common
Importance: Low
Type: Connectivity
This error means that too many emails are sent or too many recipients are in the sending queue. When an error 452 is shown that means that the server storage limit is exceeded which is typically caused by a message overload. No worries in this case because commonly the next sending attempt will succeed.
Otherwise, an OUT OF MEMORY mark will appear and your email will not be sent.
What you should do if you encountered this error
- Reduce your hourly sending limit
- Check your Hosting/VPS size and RAM or contact your Hosting/VPS provider
SMTP Error 451
Frequency: Frequent
Importance: Medium
Type: Connectivity
This error means that the “Requested action is aborted or a Local Error is processing”. Your ISP has encountered a connection problem. This is usually a temporary error due to high traffic, but it can also be because your ISP rejects the message for content reasons.
What you should do if you encountered this error
If you encountered this many times, ask your Email Marketing Platform or your SMTP provider to fix this problem.
SMTP Error 450
Frequency: Frequent
Importance: High
Type: Connectivity / Sending Reputation
This error means that the “Requested action was not taken and the recipient’s email address is not available”.
The causes are either:
- The recipient’s mailbox was corrupted
- No incoming server is found
- Your email has been blacklisted by spam radars
In any case, your server will reload again and will try to send out the email after some time.
What you should do if you encountered this error
You can check a website like MXToolbox in order to find out the problem and check whether your sender IP is blacklisted or not.
SMTP Error 449
Frequency: Rare
Importance: Medium
Type: Connectivity
This error is exclusively a routing issue related only to Microsoft Exchange configuration.
What you should do if you encountered this error
Try to contact either your host support or Microsoft Exchange support, they usually answer within 24 hours
SMTP Error 447
Frequency: Common
Importance: Low
Type: Sending Limit
This error means that your message timed out because of issues in the incoming server side. This happens when you exceed your server’s sending limit, and probably the bundle or the package you bought from your Email Marketing Platform does not fit anymore with your number of recipients.
If you are managing your MTA by yourself, you can increase this limit at any time. You have just to be careful enough to be aware of the spam mark problems.
What you should do if you encountered this error
Try to either increase your sending capacity or segment your list to little parts
SMTP Error 446
Frequency: Rare
Importance: Medium
Type: Connectivity
This error means that there was an infinite loop in the message-sending attempt that happened.
What you should do if you encountered this error
You can check your SMTP log in this case or simply check with an Email Marketing Platform or SMTP provider
SMTP Error 442
Frequency: Rare
Importance: High
Type: Connectivity
This error means that the connection dropped in the handshake step. This is a very typical connectivity issue, probably due to your VPS, VDS, or router, but should be fixed quickly.
What you should do if you encountered this error
Check immediately your server status, even though this type of error is rare because nowadays servers response time is generally between 99.6% and 99.9%
SMTP Error 441
Frequency: Common
Importance: Low
Type: Connectivity
This error means that the recipient’s server is not responding. It’s a common error but with a very low importance
What you should do if you encountered this error
No worries, your server will try automatically to resend the message
SMTP Error 432
Frequency: Rare
Importance: Medium
Type: Connectivity
This error is exclusively a routing issue related only to Microsoft Exchange configuration exactly like Error 449.
What you should do if you encountered this error
Try to contact either your host support or Microsoft Exchange support, they usually answer within 24 hours
SMTP Error 431
Frequency: Frequent
Importance: High
Type: Server Memory / Email List Size
This error means that there is not enough space on the server disk, or the disk RAM is ran out of memory because of a file overload and too many messages were sent to a particular domain.
What you should do if you encountered this error
Try to segment and split your lists to small batches, instead of sending all at once.
SMTP Error 422
Frequency: Common
Importance: Low
Type: Recipient’s Mailbox
This error means that the recipient’s mailbox has exceeded its storage limit. It’s a very common error and usually is called a Soft Bounce.
What you should do if you encountered this error
Again, verify your email list with a mail list validator that has the feature “MX”. We highly recommend SMTPing in this case.
Error 421 SMTP
Frequency: Frequent
Importance: Low
Type: Connectivity
This service is unavailable at the moment due to connection difficulties. There may be an issue with your network, or it may just be temporarily unavailable. Your or your recipient’s server is momentarily unavailable, so there will be an automatic retry thereafter.
What you should do if you encountered this error
Nothing, just wait until your message is sent
SMTP Error 420
Frequency: Rare
Importance: Medium
Type: Connectivity / Timeout
This error means that there is a Timeout connection problem between your and your recipient servers. This type of error is only shown by GroupWise servers, so it is either there’s a hardware problem or simply your email has been blocked by the recipient’s firewall, which is common too.
What you should do if you encountered this error
Check with your service provider.
SMTP Error 354
Frequency: Rare
Importance: Low
Type: Email Format
This error means that the incoming server has received the “From” and “To” details of the email, and is currently waiting to get the body of the message (the content).
What you should do if you encountered this error
Try to check your email if you are sending an HTML email. Convert your email to plain text mode, send it, and resend it again with the HTML version
SMTP Error 252
Frequency: Rare
Importance: High
Type: Connectivity / Handshake
This error means that the EHLO shake between the 2 parts is not possible, but the message will be sent anyway.
Normally the server transfers the email to another one that will be able to check it (a kind of rotation). The email is valid, but not really verifiable.
What you should do if you encountered this error
You can forget about it. If you face some issues or got a considerable number of bounces, try to validate your email list with SMTPing
SMTP Error 251
Frequency: Rare
Importance: Low
Type: Connectivity
This error means that the recipient’s email is not on the current server, so it will be relayed to another one.
What you should do if you encountered this error
You can forget about it
SMTP Response 250 (250 OK)
250 result is not an error. 250 answer is a message sent when your email is successfully sent.
SMTP Response 221
221 is a response and not an error neither. It’s a “Goodbye” or a closing connection response to say that all messages have been processed.
SMTP Response 220
220 is a response and not an error neither. It’s just a welcome message.
SMTP Response 214
214 is a response to the HELP query. It contains information about your server, normally leading to a FAQ page.
SMTP Response 211
It’s a System Status message notification information about the server.
SMTP Error 111
Frequency: Rare
Importance: High
Type: Connectivity
This error means that the Connection is refused or not able to open an SMTP connection. It’s a very rare error but could happen.
What you should do if you encountered this error
Verify your SMTP connection, the connection type, and the sending port.
SMTP Error 101
Frequency: Rare
Importance: High
Type: Connectivity
This error means that the sending server is unable to connect.
What you should do if you encountered this error
Verify your SMTP connection, the connection type, and the sending port.
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
Closed
kilinkis opened this issue
Dec 11, 2013
· 25 comments
Comments
hello guys. I need help please
this is my code:
require 'PHPMailerAutoload.php'; $mail = new PHPMailer; $mail->isSMTP(); $mail->Host = "smtp.gmail.com"; $mail->SMTPDebug = 2; $mail->SMTPAuth = true; $mail->SMTPSecure = "ssl"; $mail->Port = 465; $mail->Username = 'some@gmail.com'; $mail->Password = 'somepass'; $mail->addAddress('another@gmail.com', 'Josh Adams'); $mail->Subject = 'PHPMailer GMail SMTP test'; $body = 'This is the HTML message body <b>in bold!</b>'; $mail->MsgHTML($body); if (!$mail->send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message sent!"; }
and I get this error:
2013-12-11 15:15:02 SMTP ERROR: Failed to connect to server: Network is unreachable (101) SMTP connect() failed. Mailer Error: SMTP connect() failed.
any help please?
You shouldn’t use SSL on port 465; use TLS on 587. You might find it useful to refer to the example script that does exactly what you’re looking for — it’s why we wrote it.
Aside from that, if you’ve got connectivity problems, it’s nothing to do with PHPMailer.
thanks Synchro
I tried TLS on 587 and got the same error.
Also, I tried that example before, in fact was the first thing I tried but it didnt work.
Well if your connection is failing it doesn’t matter if you try XYZ on 12345. Sort out your connectivity first.
any help on how can I fixed that please? i see the php_info if you need to know something. Thanks
First wait a day, because Gmail seems to have problems for the SMTP currently.
@kilinkis you’re looking in the wrong place — it’s like an accident has blocked the road ahead of you and traffic is at a standstill, and you’re asking us how to fix your car so you can drive on. Your car is not the problem!
As @myildi says, wait until it’s fixed, or use a different provider.
I’ve got the same problem.
My hosting provider is GoDaddy (which is a Linux Server), and I tried to use PHPMailer to send a mail via my Gmail acc, but it just show me «Connection refused (111) » every time. Could somebody help me???
It would possibly help if you actually read this thread before posting, and maybe even read the docs.
Uh, in fact, I trid TLS and 587 port. But doesn’t work either. Is this a bug or I should pay for this??
No, it’s not a bug. As this thread (and the docs) says, it’s a connectvity problem within your ISP. Ask them to fix it — it’s nothing to do with PHPMailer.
Oh..But I think there’re so many people faced this problem, why don’t they fix it?..
They do it deliberately — GoDaddy is something of a bottom-feeder amongst ISPs. They have a perpetual fight against people using their servers for spamming, so you have to ask them to allow outbound email. Alternatively, use an ISP that’s not cheap ‘n’ nasty.
i am getting this error while using PHPMailer
SMTP connect() failed. Message could not be sent.Mailer Error: SMTP connect() failed.
So read this thread and try the suggestions in it instead of asking blindly.
i tried all the ways but i not connecting
this is wat am i trying
$mail = new PHPMailer; $mail->SMTPDebug = 2; $mail->isSMTP(); $mail->Mailer = 'smtp'; $mail->Host = 'smtp.gmail.com'; $mail->SMTPAuth = true; $mail->Port= 587; $mail->Username = 'prasanna.venkatesan83@gmail.com'; $mail->Password = '************'; $mail->SMTPSecure = 'tls'; $mail->From = 'prasanna.venkatesan83@gmail.com'; $mail->FromName = 'Prasanna'; $mail->addAddress($to, 'Prasanna'); $mail->addReplyTo($to, 'Prasanna'); $mail->WordWrap = 50; $mail->isHTML(true); $mail->Subject = $subject; $mail->Body = $message; //echo !extension_loaded('openssl')?"Not Available":"Available"; if(!$mail->send()) { echo 'Message could not be sent.'; echo 'Mailer Error: ' . $mail->ErrorInfo; exit; }
So you know for sure that your DNS is working perfectly and you can telnet to smtp.gmail.com outside of PHPMailer, as the docs suggest you try?
how can i check DNS working or not?
As I said, read the docs that are linked from this thread!!! You claimed you already read them, but you clearly didn’t.
Check your network configuration, ask your ISP. It’s not a PHPMailer problem.
dig +short smtp.gmail.com
telnet smtp.gmail.com 587
i have tried this but it’s still not connected
Sigh. Right. Because it’s a network problem. Ask your ISP to fix it. There’s nothing we can do here.
can i able to do it by myself can you tell the way to solve it
Yes, you can fix it yourself by asking your ISP. No, I can’t tell you how to do that.
PHPMailer
locked and limited conversation to collaborators
Nov 10, 2014
Simple Mail Transfer Protocol имеет ряд связанных кодов ошибок, некоторые относятся к доставке почты, в то время как другие сосредоточены на связи. Вот некоторые из наиболее распространенных ошибок и что вы можете сделать, чтобы помочь решить проблему:-
Коды ошибок, начинающиеся с 1 – Сервер по теме
SMTP Ошибка 101 – Не может подключиться к серверу. Если вы видите эту ошибку при попытке отправить по электронной почте вероятность того, что вы указали сервер SMTP неправильно. Двойная проверка сервера, особенно префикс домена, некоторые общие примеры включают почту. SMTP. вне. Отправить по почте. Если вы уверены, что у вас есть правильный адрес сервера, то убедитесь, что вы используете правильный номер порта, порт 25 является стандартным, но это может привести свои собственные проблемы.
SMTP Ошибка 111 – В соединении отказано. Похожий на 101, решение также одинакова.
Коды ошибок, начинающиеся с 4 – Доставка почтой / Маршрутизация Проблемы
SMTP Ошибка 421 – Сервис недоступен. Это, как правило, относится к удаленному серверу быть вниз, dpending о том, как вещи выполнены в обычно приводит к передаче, автоматически повторен позже. коды 441 и 442 обусловлена подобные обстоятельства.
SMTP Ошибка 447 – Сообщение Time Out. Вы пытаетесь вбить большой список рассылки не вы? Если вы получаете эту ошибку в первую очередь попробуйте отправить почту в небольших партиях.
SMTP Ошибка 450 – Требуемое действие было отклонено. Это Телль ошибка выдумки, что ваш адрес электронной почты был занесен в черный список, сервер получателей активно отвергая электронной почты, который вы пытаетесь доставить.
SMTP Ошибка 500 – Синтаксическая ошибка. Обычно ваш анти вирус будет виноват. ошибка 501 может также произойти.
SMTP Ошибка 503 – Bad Sequence. 99 раз из ста это проблема аутентификации, сервер SMTP ожидает определенный тип аутентификации, но почтовый клиент бьет его с другим набором команд.
SMTP Ошибка 512 – DNS проблема. Почтовый сервер для одного из получателей не может быть найден, двойная проверка, чтобы убедиться, что вы не поставили в недопустимых областях.
SMTP Ошибка 541 – Получатель отклонил почту. Вы почта была отклонена, скорее всего, из-за спам-фильтр.
SMTP Ошибка 550 – Получатель не существует. Принимающий сервер даст вам знать, что он не имеет адрес, который вы указали, В этом случае вам нужно найти другой способ связаться с человеком, чтобы получить их правильный адрес электронной почты.
SMTP Ошибка 552 – Превышен хранения Allocataion. Вы пытались отправить сообщение, которое является слишком большим, попробуйте удалить / сжать вложения. Честно говоря, это редко с современными учетными записями электронной почты, но некоторые небольшие Интернет-провайдеры по-прежнему весьма ограничительным с почтовым ящиком и индивидуальных лимитов почты.
SMTP Ошибка 554 – Доставка почты не удалась. Это постоянная ошибка и всех кодов является один меньше всего хотите увидеть. Это, как правило, очень хорошо inidcation, что вы были в черном списке.
Есть еще несколько кодов, любой, начинающиеся с 2 как правило, успех / обновление статуса и не о чем беспокоиться,. Проблема с некоторыми из вышеуказанных кодов, что они могут потребовать некоторую информацию от вашего поставщика услуг электронной почты, в том, что ваш провайдер, веб-сайт хост или провайдер почты третьего участника. Большое количество из них очень мало понимания процесса почты и может оставить вас ходить кругами. Именно по этой причине мы рекомендуем использовать сервер SMTP2Go, Все их бизнес доставка почты и всегда будет undertand любых вопросов, вы можете иметь.
For some reason I have an error while running this code:
with smtplib.SMTP_SSL('smtp.yandex.com.tr', 465) as server:
server.login(email_from, password_from)
server.sendmail(
from_addr='mymail@yandex.ru',
to_addrs='yourmail@yandex.ru',
msg='Hello'
)
The error is:
Traceback (most recent call last):
File "report.py", line 86, in <module>
send_report()
File "report.py", line 82, in send_report
notificate(*create_html_msg())
File "report.py", line 69, in notificate
with smtplib.SMTP_SSL('smtp.yandex.com.tr', 465, context=context) as server:
File "/usr/lib/python3.8/smtplib.py", line 1034, in __init__
SMTP.__init__(self, host, port, local_hostname, timeout,
File "/usr/lib/python3.8/smtplib.py", line 253, in __init__
(code, msg) = self.connect(host, port)
File "/usr/lib/python3.8/smtplib.py", line 339, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "/usr/lib/python3.8/smtplib.py", line 1040, in _get_socket
new_socket = socket.create_connection((host, port), timeout,
File "/usr/lib/python3.8/socket.py", line 808, in create_connection
raise err
File "/usr/lib/python3.8/socket.py", line 796, in create_connection
sock.connect(sa)
OSError: [Errno 101] Network is unreachable
OS is Ubuntu 20.04. My code runs perfectly on the other machine, so the problem is obviously somewhere with the machine.
I’ve tried:
sudo ufw allow 465/tcp
Also I installed and run postfix mail server and added this to /etc/postfix/main.cf:
smtps inet n - y - - smtpd
-o syslog_name=postfix/smtps
-o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes
-o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject
-o content_filter=smtp-amavis:[127.0.0.1]:10026
and then restarted postfix with
sudo systemctl restart postfix
But nothing solved the problem. Please help me with this error.