Error when opening smtp stream

SMTP Status Codes This document describes the set of extended status codes for use within the SMTP mail system for delivery status reports, tracking, and improved diagnostics. In combination with other information provided in the Delivery Status Notification (DSN) delivery report, these codes facilitate media and language independent rendering of message delivery status. These […]

Содержание

  1. SMTP Status Codes
  2. Status Code Structure [ edit | edit source ]
  3. Status Codes [ edit | edit source ]

SMTP Status Codes

This document describes the set of extended status codes for use within the SMTP mail system for delivery status reports, tracking, and improved diagnostics. In combination with other information provided in the Delivery Status Notification (DSN) delivery report, these codes facilitate media and language independent rendering of message delivery status.

  • These codes are documented in RFC 3463
  • SMTP Server Status Codes and SMTP Error Codes

Status Code Structure [ edit | edit source ]

This document defines a new set of status codes to report mail system conditions. These status codes are used for media and language independent status reporting. They are not intended for system specific diagnostics.

The syntax of the new status codes is defined as:

White-space characters and comments are NOT allowed within a status-code. Each numeric sub-code within the status-code MUST be expressed without leading zero digits.

Status codes consist of three numerical fields separated by «.». The first sub-code indicates whether the delivery attempt was successful. The second sub-code indicates the probable source of any delivery anomalies, and the third sub-code indicates a precise error condition.

The code space defined is intended to be extensible only by standards track documents. Mail system specific status codes should be mapped as close as possible to the standard status codes. Servers should send only defined, registered status codes. System specific errors and diagnostics should be carried by means other than status codes.

New subject and detail codes will be added over time. Because the number space is large, it is not intended that published status codes will ever be redefined or eliminated. Clients should preserve the extensibility of the code space by reporting the general error described in the subject sub-code when the specific detail is unrecognized.

Status Codes [ edit | edit source ]

Error Code Meaning Notes
1.0.1 Cannot open connection Typically your SMTP server or email program is unable to even start an SMTP session. Typical replies will be “SMTP Error 101, Error opening connection” or “SMTP Error 101, cannot open SMTP stream”.

All SMTP Error 101 errors usually point to a configuration problem, such as an incorrectly spelt SMTP server, or an IP address that does not exist, or an SMTP port that does not exist or which the recipient will not accept SMTP connections on, or some other process is already using the default SMTP port, port 25.

1.1.1 Connection refused Typically from Linux based email systems such as SquirrelMail and Mailman. The message will usually go like this : “Connection refused, 111 Can’t open SMTP stream”.

All SMTP Error 111 errors usually point to an inability of your server to communicate with the remote SMTP server (either the recipient’s SMTP server or your ISP’s SMTP server) or to a Linux/SMTP software configuration problem, typically /etc/hosts not being world readable, or a newly installed or reconfigured firewall preventing connection to the remote SMTP server, or incorrect hostnames and/or domains (e.g. does your sending hostname match your IP address in a reverse lookup?), or exim not running. Telnet and logs should help you home in on the problem.

Status Code 2.X.X — Success Messages 2.1.1 System Status message or System Help Reply SMTP status 211 prefaces a message about the Mail Server status or a System Help reply to the user requesting help information. You might for example issue a command to the mail server to display a list of commands you can use and the server replies with an SMTP Reply 211 followed by the list you requested. 2.1.4 Help Reply message SMTP status 214 is usually in reply to the “HELP” command.It displays information about the server, usually a URL to the FAQ page of the SMTP software running on the server. As a result this “error” is normally called a reply, as in SMTP Reply 214. 2.2.0 service is running This is normally the first message you will get back from the server. It means the mail service is running (ie. your mail server is running). It will normally contain a welcome message and/or the title of the SMTP software and, sometimes, the version number of the mail server software.SMTP Reply 220 is effectively a “Hi There, I have just this second finished starting up – I am ready to go and at your command” informational message. 2.2.1 The domain service is closing the transmission channel The server is ending the mail session – it is closing the conversation with the ISP as it has no more mail to send in this sending session.

SMTP Status 221 is often misconstrued as an error condition, when it is in fact nothing of the sort. The mail server is simply telling you that it has processed everything it was given in this particular session, and it is now going back into waiting mode.

Because SMTP status 221 is often misinterpreted, with some mail servers the Network Administrators have changed the default text of SMTP Reply 221 to something more meaningful and less alarming. For example, a typical SMTP reply 221 might say “221 Goodbye” or “221 Closing connection”, or the most irritating one we’ve seen “221 Bye”, Arrrgghh–can you blame anyone for thinking there might be a problem? Of course not! So some Network Administrators are these days being quite imaginative by changing the default text of SMTP reply 221 to more user friendly messages like : “221 Thank you for your business”(I love that one!),or “221 All messages processed successfully in this session, SMTP connection is closing”.

2.1.4 Help Reply message SMTP status 214 is usually in reply to the “HELP” command. It displays information about the server, usually a URL to the FAQ page of the SMTP software running on the server. As a result this “error” is normally called a reply, as in SMTP Reply 2.1.4. 2.2.0 service is running This is normally the first message you will get back from the server. It means the mail service is running (ie. your mail server is running). It will normally contain a welcome message and/or the title of the SMTP software and, sometimes, the version number of the mail server software. SMTP Reply 220 is effectively a “Hi There, I have just this second finished starting up – I am ready to go and at your command” informational message. 2.2.1 The domain service is closing the transmission channel The server is ending the mail session – it is closing the conversation with the ISP as it has no more mail to send in this sending session.

SMTP Status 221 is often misconstrued as an error condition, when it is in fact nothing of the sort. The mail server is simply telling you that it has processed everything it was given in this particular session, and it is now going back into waiting mode.

Because SMTP status 221 is often misinterpreted, with some mail servers the Network Administrators have changed the default text of SMTP Reply 221 to something more meaningful and less alarming. For example, a typical SMTP reply 221 might say “221 Goodbye” or “221 Closing connection”, or the most irritating one we’ve seen “221 Bye”, Arrrgghh – can you blame anyone for thinking there might be a problem ? Of course not ! So some Network Administrators are these days being quite imaginative by changing the default text of SMTP reply 221 to more user friendly messages like: “221 Thank you for your business” (I love that one!), or “221 All messages processed successfully in this session, SMTP connection is closing”.

2.5.0 Requested mail action OK completed The mail server has successfully delivered the message! This is the best SMTP reply (250) to receive — your message has been accepted and transmitted OK ! 🙂 Yippee.

250 is effectively a status code rather than an error code – there is no such thing as an SMTP error 250.

2.5.1 User not local will forward The email account is not local to the ISP server but the ISP server will accept the email and will forward it (the server will RELAY your message, this is the

most common action for ISP Mail servers – the recipient will see your ISP in the mail header as one of the first hops on the way to the recipient’s email system).

SMTP Error 251 is therefore more of an informational message for technicians tracking how a message reached its destination.

2.5.2 Cannot VRFY (verify) the user – the server will accept the message and attempt to deliver it The user account appears to be valid but could not be verified, however the server will try do

deliver the message.

There are sometimes circumstances where an email address appears to be valid but cannot be verified as definitely valid during the SMTP session between the sending server (your server) and the next server to accept your message. This can happen for example in very large corporation where the first email receiving server might only be an email exchanger server, a gateway server to the eventual server which holds the user mailboxes and which can verify if the intended recipient exists in that organization. When this happens the gateway server will reply with an SMTP Error 252 telling your sending server that it cannot verify the user part of the email address, that the domain part is OK, and that it will forward your email to a server which can do the checking and eventually deliver to the user mailbox if it exists.

Status Code 3.X.X — Informational 3.5.4 Start mail input end with . , or, as a less cryptic description – “FROM and TO information received, now please provide message body and mark its end with . ” This is normally in response to the DATA command. The server has received the From and To information and is now asking for the “Message Body”, the main part of the message which should be ended by two blank lines separated by a dot (period).

Therefore, on receiving an SMTP Reply 354 the sending server should send the body of the message to the receiving server and indicate the end of the message body with . (note the full stop between the two Carriage_Return-Line_Feed’s).

Status Code 4.X.X — Persistent Transient Failure 4.2.0 Timeout communication problem encountered during transmission. This is a Novell GroupWise SMTP error In our experience only Novell GroupWise servers use this error (we use GroupWise!). You will get a GroupWise GWIA (GroupWise Internet Agent) 420 TCP Write Error or 420 TCP Read Error if there are communication problems during transmission of the actual message after the sending and receiving servers have actually connected. A small number of 420 SMTP errors is normal as occasional peaks of Internet usage may delay the transmission of an email with attachment so much that a timeout occurs. When a timeout occurs on a GWIA send, the message is queued up in the WPGATEDEFER directory for processing at a later time (as defined in ConsoleOne or GWIA.CFG).

If you experience 420 errors only with specific recipient then it is quite likely that the recipient’s antispam firewall does not like your server, your server’s external IP address, or that your server’s HELO command uses an outbound identification that does not match your server’s external IP address (check that your sending domain’s DNS is set up correctly). In an ideal world a well behaved recipient server should really be issuing your GroupWise server with a 554 error rather than timing out and causing the GroupWise GWIA to fault with a 420 error.

If you experience too many 420 errors with all email communications, then you have a physical communication problem somewhere. This could be your server’s network card, the network point that your server is plugged into, your switch(es), your router(s), your firewall, or your Internet line – problems caused by routers with different MTU sizes is a classic issue. Unless the logs of all those various problem points can give you an instant answer, the only way you will get to the bottom of the problem is to use a packet tracing and inspection program like Ethereal or Wireshark, its successor, if you’re running GroupWise on a Windows or Linux server; on NetWare your only choice is PacketScan which you can get here http://support.novell.com/docs/Readmes/InfoDocument/2967287.html. In the final analysis, if the tracing of packets, and the changing of hardware does not help then do not discount a slightly faulty hard disk being the cause of all your problems (even if your RAID controller or your hard disk testing software does not detect any problem!).

4.2.1 The SMTP service/server you use has a limit on the number of concurrent SMTP streams your server can use The Mail transfer service is unavailable because of a transient event. SMTP reply

421 can be caused by many things but generally indicates that the mail server which returns this status code is currently unavailable but may be available later.

For example, the server administrator may have stopped the mail service to troubleshoot a problem, or the mail server is right in the middle of rebooting, or the mail server is currently processing too many incoming messages or incoming requests, etc. Note : “Mail Server” in this case can be any of the mail servers on the message’s route – the sending server (your server), the ISP SMTP server, or the recipient’s mail server.

Clearly, if you repeatedly receive an SMTP status 421 then the problem is no longer of a transient nature and you need to investigate or inform the relevant network administrator, ISP tech support, or the recipient.

SMTP Response 421 can also be received as a result of your message server sending an email where the total number of TO, CC, and BCC users results in a number of simultaneous SMTP connections that is in excess of the number of connections your ISP or SMTP service allows. A typical error message for this situation would be : “421 Too many concurrent SMTP connections from this IP address; please try again later”. Typically, when this happens your server will have sent some of the messages (note that for all servers, each email sent by a user always gets broken down into individual separate emails to each of the recipients in the TO, CC, and BC fields), and will automatically retry a little later to send the remaining messages.

4.2.2 The recipient’s mailbox is over its storage limit

The size of the message exceeds the recipient’s size limits for incoming email Either the recipient’s mailbox is over its storage limit or the message delivery directory (folder) on the recipient’s mail server is currently over a size limit imposed by the Network Administrator (e.g. possibly as a result of the mail server having been down for some time, having been repaired, and currently in the process of collecting thousands of queued up messages).

However, SMTP response 422 can also be received if the email being sent is larger than the incoming emails size limit in operation at the recipient’s mail server (particularly when that recipient’s mail server is Exchange Server).

4.3.1 The recipient’s mail server is experiencing a Disk Full condition The recipient’s mail server is experiencing a Disk Full error condition, or an Out of Memory (too many file handles) error condition (Microsoft Exchange). 4.3.2 The recipient’s Exchange Server incoming mail queue has been stopped This is an SMTP status response specific to Microsoft Exchange Server. It indicates that the recipient’s mail queue on their Exchange Server has been stopped (frozen), probably while the Network Administrator troubleshoots some problem. 4.4.1 The recipient’s server is not responding This is an error emanating from your server indicating that the recipient’s server is not responding. Your server will automatically try again a number of times – how many depends on how your server has been configured. 4.4.2 The connection was dropped during transmission Your server started delivering the message but the connection was broken during transmission. This may be an unusual transient error – however, if it keeps happening you should investigate possible problems with your server’s network card, your Internet routers, processes hogging the resources of your server, and anything else which could result in a network connection being broken. 4.4.6 The maximum hop count was exceeded for the message The maximum hop count was exceeded for your message. The most likely cause of this error status code is that your message is looping internally on your server, internally between two of your organisation’s servers, or, sometimes, looping between your server and the recipient’s server. 4.4.7 Your outgoing message timed out. Your outgoing message timed out because of problems with the receiving server who objected to your message. Typically there is a problem with the message header (such as too many recipients, in most cases, or a protocol timeout between the two servers). 4.4.9 Routing error This is a Microsoft Exchange Server specific error code. As per Microsoft’s documentation this error code is returned when either of the following conditions occurs: an SMTP connector is configured to use DNS without a smart host and also uses a non-SMTP address space (e.g. X.400), or A message was sent to a recipient who was identified as a member of a routing group that was deleted. 4.5.0 Requested action was not taken – The mailbox was unavailable at the remote end. A secondary SMTP error code may follow “450” to refine the reason for the failure to transmit the message, e.g. “SMTP Error 450”. The server could not access the mailbox to deliver the message. This could be caused by a process on the remote server tidying up the mailbox, or the remote mailbox could be corrupt, or the remote mailbox may be stored on another server which is currently offline, or the network connection went down while sending, or the remote mail server does not want to accept mail from your server for some reason (IP address, blacklisting, etc..).

In general SMTP Error 450 is a transient error at the remote end (the destination), or at one of the routers or servers en route to the remote end, and should induce your mail server to retry after it’s preset retry interval. Example of an SMTP Error 450 reply message: “450 Please try again later”, or a classic Novell GroupWise 450 status message: “The message that you sent has been delayed. The reason given for the delay: 450 Host down (relay.clara.net)”.

SMTP Error 450 is often followed by a second SMTP error code to refine the reason for the email not reaching its destination. For example: “SMTP Error 450 5.2.3 Msg Size greater than allowed by Remote Host”. When that is the case and If the error message is not as clearly worded as in this example, then simply search this document for the secondary error code. In this case searching this document for SMTP Error 523 or SMTP Error 5.2.3 would yield an explanation identical to the wording above.

4.5.1 Requested action aborted – Local error in processing.

( OR )
Requested action delayed – Local problem

( OR )
has recently sent spam The action has been aborted by the ISP’s server. “Local” (Local Problem, Local Error) refers to the next server that your message will go through after leaving your server, typically your ISP’s server, or the SMTP relaying service you are using, or, if your mail server is sending directly to the destinations, the destination mail server. This error is usually due to overloading at your ISP or your SMTP relaying service from [temporarily] too many messages or some other similar transient failure. Typically some [hopefully] temporary event prevents the successful sending of the message. The next attempt to send by your server may prove successful.

If this error keeps occurring to the point that it has effectively lost its transient nature and has become. frequent (!!), then the problem is at your end and you should check your own mail server (if you email out of a corporate network), communications on your side (router, server network card), or inform your ISP if your mail server relays through your ISP or if you are a home user emailing out through Outlook, Outlook Express, Windows Mail, or similar email program.

Examples of typical SMTP Error 451 return messages: “SMTP error 451 Unable to complete command, DNS not available or timed out” or “451 Domain of sender address does not resolve” or “451 Error getting LDAP results in map”, or “451 4.7.1 Greylisting in action, please come back in 00:02:00 [minutes]” or “The message that you sent has been delayed. The reason given for the delay : 451 Temporary local problem — please try later.”.

With the original SMTP standards having been invented before spam became the scourge of the Internet, there are no SMTP error codes dedicated to anti-spam errors. As a result, SMTP Error 451 is now increasingly also used to indicate that a message has been rejected by the remote server because of anti-spam measures. A typical error might be, for example: “SMTP error from remote mail server after end of data, host : 451 has recently sent spam. If you are not a spammer, please try later.”.

If all anti-spam related SMTP 451 errors are as descriptive as the one above, then the error itself will tell you what you need to do. As a general rule, however, you will most times need to take some measures to have either your server, or your ISP’s server, taken off some Internet blacklist used by the recipient.

4.5.2 Requested action not taken – Insufficient storage. The ISP server’s disk system has run out of storage space, so the action had to be cancelled. Unless you are with an ISP which is so slack that they have not implemented Disk Full Alerts, this error usually indicates that your ISP’s mail server is overloaded from too many messages. This can happen even to the best ISPs when, for example, there have been problems and none of the ISP’s customers could send mail; as soon as the problems are fixed there is almost always a situation where thousands of users and organizations are trying to send mail all at the same time, and those numbers can occasionally result in the ISP’s mail servers’ hard disks temporarily filling up, with SMTP Error 452 being the result. The next attempt to send by your server may prove successful. 4.6.5 Code Page unavailable on the recipient server This is an Exchange Server-specific error code. This error is returned by the recipient’s server if the incoming email specifies a Code Page that is not installed on the recipient’s server, normally because not all language files were installed on the server during either the installation of Windows or of Exchange Server. 4.7.1 This is a local error with the sending server and is often followed with “Please try again later” This is always a local error with your own mail server. SMTP Error 471 (or 4.7.1) is usually tagged onto a primary SMTP error code, for example “SMTP Error 450 4.7.1”, or “SMTP Error 451 4.7.1”, or “SMTP Error 550 4.7.1”; example: “451 4.7.1 Greylisting in action, please come back in 00:02:00 [minutes]”. In all the cases that we have seen SMTP Error 471 is usually caused by anti-spam or virus scanning software on your server (the sending server) getting into problems through a bug in the software, or because of a bad automatic update from the antivirus/anti-spam manufacturer, because of lack of memory on your server, or because of hard disk problems. Status Code 5.X.X — Errors 5.0.0 Syntax error command not recognized. SMTP Error 500 : The last command sent by your server was not recognized as a valid SMTP or ESMTP command, or is not formatted in the way the server expected. This includes situations where the command is too long.

Note that commands that are recognized, but not implemented, are handled by different status messages (see 502 and 504).

Note: A «500 unrecognized command» server response is often a case of antivirus software and/or firewall interfering with incoming and/or outgoing SMTP communications. Read your antivirus / firewall software documentation thoroughly to solve the problem.

Examples of SMTP Error 500 error messages: SMTP Permanent Error: 500 Access Denied By Port Access” or “SMTP Error 500 Line too long.

5.0.1 Syntax error in parameters or arguments (e.g. invalid email address)
Can sometimes also be indicative of communication problems. The command was correct and recognised, but the parameters (the arguments, e.g. email address) were not valid.

For example, the following email address will definitely give an SMTP Error 501 with most mail servers, happy[email protected], as “” is not allowed in email addresses, which makes this email address invalid.

In the vast majority of cases SMTP Error 501 is caused by invalid email addresses, an invalid domain name recipient, or a Unix / Linux SEND MAIL command which does not follow the established standards. For example, a typical return error message might be: » does not like recipient. Remote host said: 501 Invalid Address«.

In cases where the error is not caused by an invalid email address, or by the failure to assign a valid email address to the mandatory «From» property, an SMTP Error 501, particularly if repeated, can be indicative of communications problems, such as a noisy line, intermittent drops in network connections, etc.

5.0.2 Command not implemented The command or function issued by your mail server is valid but has not been activated (typically, it is not supported on this particular server). 5.0.3 Bad sequence of commands.

( OR )
This mail server requires authentication. In the original standards SMTP Status 503 indicates that the commands have been sent in the wrong order, for example your mail server has sent the “Hello” command before sending the “Mail” command.

This can often be caused by a drop in network connection just as your server was sending a command, resulting in the ISP’s server not receiving it and consequently not understanding the command that followed it.

SMTP Reply Code 503 is nowadays more often an indicator that the SMTP server you are trying to use requires authentication and you tried to send a message without authentication (username + password). This SMTP Error 503 is permanent in that the SMTP server will not log any errors in its log and it will not retry – you will have to resend the email using authentication. Example of such an error : “SMTP Error (state 13): 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server”.

5.0.4 Command parameter not implemented. The command and parameter are both valid, but the parameter is not implemented on the ISP server, or an additional parameter or action is missing.

For example, an often encountered SMTP Error 504 is : “504 Need to authenticate first”

5.1.0 Bad Email Address Bad email address. This status code is generated by the sender’s local mail server.

If the email was addressed internally, then it means that the addressee, as written in the email’s TO, CC, or BCC fields, does not exist in your organization’s email system.

If the email was addressed externally, then the recipient’s email address was misspelt.

5.1.1 Bad Email Address Bad email address. This error is similar to error 510 and as with error 510, this status code is generated by the sender’s local mail server.

If the email was addressed internally, then it means that the addressee, as written in the email’s TO, CC, or BCC fields, does not exist in your organization’s email system.

If the email was addressed externally, then the recipient’s email address was misspelt.

5.1.2 The host server for the recipient’s domain name cannot be found (DNS error) This SMTP reply code is received when one of the servers on the way to the destination is unable to resolve the domain name of a recipient email address. Said differently : one of the servers on the way to the destination, including your server or your ISP, has a DNS problem or, possibly correctly, does not like one of the email addresses in the message’s TO, CC, and BCC fields.

The first check you should perform to resolve a 5.1.2 reply code is to check all the recipient email addresses for incorrect domain names (misspelt domain names, or, maybe, totally non-existent domain names) – remember, error code 512 is very specifically an error with the domain name of one of the recipient email addresses. You can call the recipient(s) or use the WHOIS tool of The Ultimate Troubleshooter. If all the recipient email addresses check out as regards the domain part of the email addresses, then one of the servers on the way to the recipient(s) has DNS problems – usually this will be one of the first 2 servers in the chain, your own mail server (or your network) or your ISP’s mail server.

Examples of typical SMTP error 512 messages : “5.1.2 — Bad destination host ‘DNS Hard Error looking up domain”, or “SMTP Error 550 5.1.2 Host unknown – host cannot be found”, or how about this fantastically informative error message “5.1.2 The message could not be delivered because the recipient’s destination email system is unknown or invalid. Please check the address and try again, or contact your system administrator to verify connectivity to the email system of the recipient.”.

5.1.3 Address type is incorrect (most mail servers)

( OR )
Relaying denied or Authentication required (a small percentage of mail servers) This status code (from the sender’s

mail server) is usually symptomatic, in an Exchange + Outlook environment, of the user’s Outlook Contacts having been imported from another system or PST and where some of the addresses are not defined correctly. Or, in any environment it is simply that the end-user simply did enter the email address completely wrongly, such as copying it from a website and not replacing “at” with “@”, e.g. : John.DoeatUCLA.edu (which should have been [email protected]), or [email protected]” (“, quotes, is not allowed in email addresses and is often included in error as a result of copying and pasting an email from somewhere).

The user should check all the recipient addresses in the email, including those that were inserted from Contacts.

5.2.3 The Recipient’s mailbox cannot receive messages this big This error will be received when the

total size of the message you have sent (ie: message + all of its attachments) exceeds the size limits on the Recipient’s server. Many companies implement the good practice of configuring their servers with limits on the size of emails they can receive to prevent their systems running out of space as a result of a spam attack where the spam emails contain large attachments, or as a result of valid but not very technically savvy senders sending enormous scans (through not knowing that scanning at 1200dpi rather than the usually perfectly usable and acceptable 300dpi, will create humongous attachments).

Check the size of the email you sent, and, specifically, the size of the attachments you included, and consider splitting your email into smaller emails. If that does not work, check with the Recipient the maximum size of email they can receive, and if that is still prohibitive then consider FTP arrangements between you and the recipient.

5.3.0 Authentication is required

( OR )
Your server has been blacklisted by the recipient’s server

( OR )
The recipient’s mailbox does not exist 5.4.1 Recipient Address Rejected – Access denied (typically by the recipient’s antispam program / appliance) 5.5.0 Requested actions not taken as the mailbox is unavailable.

550 is always a problem external to your own mail server. Usually it is at the recipient’s end, but it could also originate from inside your own “walls” through being caused, for example, by an appliance which scans your outgoing emails once they’ve left your server. 5.5.1 User not local or invalid address – Relay denied. 5.5.2 Requested mail actions aborted – Exceeded storage allocation. or Size of the incoming message exceeds the incoming size limit. 5.5.3 Requested action not taken – Mailbox name invalid.

( OR )
You are attempting to send emails through a specific ISP’s SMTP server without authentication and without being connected to the Internet through that ISP’s service.

Источник

Simple Mail Transfer Protocol i.e., SMTP is used for sending and receiving emails. Whenever an email is rejected by the third party server or by the parent email server, then SMTP produces a specific Error/Response, which can be used to troubleshoot/identify the cause of email delivery failure. We gathered most of the SMTP errors/responses users most likely encounter when performing email practises. Going further, we also included the Error/Response description and possibly responsible for the SMTP error/response and that too covered individually. You can click on the Error/Response Code or the Resolution link to learn more about the error and solution (if available) individually.

SMTP Response Number Definition How to Resolve / Examples
101 Cannot open connection How to fix SMTP Error 101
Examples: “SMTP Error 101, Error opening connection”
Examples: “SMTP Error 101, cannot open SMTP stream”
111 Connection refused or inability to open an SMTP stream How to fix SMTP Error 111
211 System status message or system help reply How to fix SMTP Error 211
214 Help message (Information on non-standard command) How to fix SMTP Error 214
220 <SERVER> Service ready How to fix SMTP Error 220
221 <SERVER> Service closing transmission channel How to fix SMTP Error 221
Examples: “221 Closing connection”
Examples: “221 Goodbye”
250 Requested mail action okay, completed How to fix SMTP Error 250
251 User not local; will forward to <REMOTEPATH> How to fix SMTP Error 251
252 Can not verify user; accepting message for attempt How to fix SMTP Error 252
354 Starting mail input How to fix SMTP Error 354
420 Timeout connection problem How to fix SMTP Error 420
NOTE: This error is related to GroupWise Servers only.
421 <SERVER> Service not available, closing transmission channel How to fix SMTP Error 421
431 Not enough storage or out of memory (See #452, #552) How to fix SMTP Error 431
432 Recipients Exchange Server incoming mail queue stopped How to fix SMTP Error 432
NOTE: This error is related to Microsoft Exchange Servers only.
441 Recipients mail server is not responding How to fix SMTP Error 441
442 Connection dropped during transmission How to fix SMTP Error 442
446 The maximum hop count was exceeded for the message: an internal loop has occurred. How to fix SMTP Error 446
447 Your outgoing message timed out because of issues concerning the incoming server. How to fix SMTP Error 447
449 A routing error. How to fix SMTP Error 449
NOTE: This error is related to Microsoft Exchange Servers only.
450 Requested mail action not taken: mailbox unavailable (e.g., mailbox not found, no access, or command rejected for policy reasons) How to fix SMTP Error 450
Examples: “450 Please try again later”
“SMTP Error 450 5.2.3 Msg Size greater than allowed by Remote Host”
451 Requested action aborted: error in processing How to fix SMTP Error 451
Examples: “SMTP error 451 Unable to complete command, DNS not available or timed out”
“451 Domain of sender address does not resolve”
452 Requested action not taken: insufficient system storage How to fix SMTP Error 452
Example: “452 Out of memory”
455 Server unable to accommodate parameters How to fix SMTP Error 455
471 An error of your mail server, often due to an issue of the local anti-spam filter How to fix SMTP Error 471
500 Syntax error, command unrecognized (This may include errors such as command line too long) How to fix SMTP Error 500
501 Syntax error in parameters or arguments How to fix SMTP Error 501
Example: “Remote host said: 501 Invalid Address”
502 Command not implemented How to fix SMTP Error 502
503 Bad sequence of commands How to fix SMTP Error 503
504 Command parameter not implemented How to fix SMTP Error 504
510 Invalid email address How to fix SMTP Error 510
511 Invalid email address (See #552) How to fix SMTP Error 511
512 A DNS error: the host server for the recipient’s domain name cannot be found. How to fix SMTP Error 512
Example: “SMTP Error 550 5.1.2 Host unknown – host cannot be found”
513 Address type is incorrect (possibly misspelled) How to fix SMTP Error 513
Examples: “SMTP error 501 5.1.3 Invalid address”
Examples: “SMTP error 553 5.1.3 User address required !”
Examples: “SMTP error 501 5.1.3 Bad recipient address syntax”
521 <DOMAIN> does not accept mail How to fix SMTP Error 521
Example: “521 5.2.1 : (CON:B1) blog.mailchannels.com/2012/09/why-did-i-get-521-5-2-1-conb1-httppostmaster-info-aol-comerrors554conb1-html“
523 The total size of your mailing exceeds the recipient server’s limits How to fix SMTP Error 523
Examples: “SMTP Error 450 5.2.3 Message Size greater than allowed by Remote Host”
Examples: “SMTP Error 552 5.2.3 Data size exceeds maximum permitted”
Examples: “SMTP Error 552 5.2.3 Message exceeds maximum fixed size”
530 Normally, an authentication problem. But sometimes it’s about the recipient’s server blacklisting yours, or an invalid email address. How to fix SMTP Error 530
541 The recipient address rejected your message: normally, it’s an error caused by an anti-spam filter. How to fix SMTP Error 541
550 Requested action not taken: mailbox unavailable (e.g., mailbox not found, no access, or command rejected for policy reasons) How to fix SMTP Error 550
Examples: “550 Invalid recipient”
Examples: “550 User account is unavailable”
Examples: “550 No such user here”
551 User not local; please try <FORWARDPATH> How to fix SMTP Error 551
552 Requested mail action aborted: exceeded storage allocation How to fix SMTP Error 552
Example: “552 sorry, mailbox user@somecompany.com is over quota temporarily (#5.1.1)”
553 Requested action not taken: mailbox name not allowed (e.g., mailbox syntax incorrect) How to fix SMTP Error 553
554 Transaction failed (Or, in the case of a connection-opening response, “No SMTP service here”) How to fix SMTP Error 554
555 MAIL FROM/RCPT TO parameters not recognized or not implemented How to fix SMTP Error 555
Код Описание
1XX
101 The server is unable to connect
111 Connection refused or inability to open an SMTP stream
2XX
211 System status message or help reply
214 A response to the HELP command
220 The server is ready
221 The server is closing its transmission channel, It can come with side messages like «Goodbye» or «Closing connection»
250 Its typical side message is «Requested mail action okay completed»: meaning that the server has transmitted a message
251 «User not local will forward»: the recipient’s account is not on the present server, so it will be relayed to another
252 The server cannot verify the user, but it will try to deliver the message anyway
3XX
354 The side message can be very cryptic («Start mail input end .»), It’s the typical response to the DATA command
4XX
420 «Timeout connection problem»: there have been issues during the message transfer
421 The service is unavailable due to a connection problem: it may refer to an exceeded limit of simultaneous connections, or a more general temporary problem
422 The recipient’s mailbox has exceeded its storage limit
431 Not enough space on the disk, or an «out of memory» condition due to a file overload
432 Typical side-message: «The recipient’s Exchange Server incoming mail queue has been stopped»
441 The recipient’s server is not responding
442 The connection was dropped during the transmission
446 The maximum hop count was exceeded for the message: an internal loop has occurred
447 Your outgoing message timed out because of issues concerning the incoming server
449 A routing error
450 «Requested action not taken – The user’s mailbox is unavailable», The mailbox has been corrupted or placed on an offline server, or your email hasn’t been accepted for IP problems or blacklisting
451 «Requested action aborted – Local error in processing», Your ISP’s server or the server that got a first relay from yours has encountered a connection problem
452 Too many emails sent or too many recipients: more in general, a server storage limit exceeded
471 An error of your mail server, often due to an issue of the local anti-spam filter
5XX
500 A syntax error: the server couldn’t recognize the command
501 Another syntax error, not in the command but in its parameters or arguments
502 The command is not implemented
503 The server has encountered a bad sequence of commands, or it requires an authentication
504 A command parameter is not implemented, Bad email address, Bad email address, A DNS error: the host server for the recipient’s domain name cannot be found
513 «Address type is incorrect»: another problem concerning address misspelling, In few cases, however, it’s related to an authentication issue
523 The total size of your mailing exceeds the recipient server’s limits
530 Normally, an authentication problem, But sometimes it’s about the recipient’s server blacklisting yours, or an invalid email address
541 The recipient address rejected your message: normally, it’s an error caused by an anti-spam filter
550 It usually defines a non-existent email address on the remote side
551 «User not local or invalid address – Relay denied»,
Meaning, if both your address and the recipient’s are not locally hosted by the server, a relay can be interrupted, 552 «Requested mail actions aborted – Exceeded storage allocation»: simply put, the recipient’s mailbox has exceeded its limits
553 «Requested action not taken – Mailbox name invalid», That is, there’s an incorrect email address into the recipients line
554 This means that the transaction has failed, It’s a permanent error and the server will not try to send the message again.

550 5.1.1 Recipient address rejected: User unknown in virtual alias table

This is the bounce back message that is received by the sender from our server if the destination email address does not exist.
The same error message is received if the recipient has a mail loop. That is, if the recipient has set a forward to another email address and that email address is forwarded back to the original one. In this case, you need to remove the loop in order to receive the emails.

If there is a forward set for an account, and an email is sent to that account, if for some reason the forwarded email is not sent, the original sender may get the above error.

For example, abc@domain.com if forwarded to abc@dom.com, if a third user xyz@dom2.com emails to abc@domain.com, he may get the above error if the forwarded email is bounced.

550 5.1.1 Protocol error

This error code ideally suggests that the sender has used SMTP protocol instead of ESMTP, thus the outbound mail of the sender was rejected. In short, the sending client doesn’t properly communicate and makes errors in the SMTP protocol.

550 5.3.2 Service currently unavailable

The error code 5.3.2 usually means that the system is not accepting network messages. We would thus need to look outside Exchange for a connectivity problem.

The error code ideally occurs ideally for two reasons which are listed below:

  1. The sending IP is blacklisted at an RBL or blacklist monitoring site. (You may verify the same by inputting the IP via this link: http://mxtoolbox.com/blacklists.aspx )

  2. There is a temporary block on the IP on our Inbound server due to multiple mails from this IP. Feel free to contact our support desk for more information and regarding de-listing the same.

554 5.7.1 Service unavailable; Client host X.X.X.X blocked using zen.spamhaus.org

This is the error message that is received of the IP address of the sender is listed at zen.spamhaus.org

For further details, please check http://www.spamhaus.org/zen

OR check http://www.spamhaus.org/query/bl?ip= and contact zen.spamhaus.org to get the IP De-listed.

550 5.7.1 : Helo command rejected: You aren’t localhost

550 5.7.1 : Helo command rejected: You aren’t localhost.localdomain.

550 5.7.1 : Helo command rejected: You are not me

Our servers do not accept SMTP HELO command as HELO localhost or HELO localhost.localdomain or HELO . We accept HELO from a valid Domain Name or your computer name which is other than your domain name. Please check with your ISP or Mail administrator for this issue.

554 5.7.1 : Relay access denied

There are couple of reasons for this error while sending an email

Please contact support.

551 5.7.1 The message was rejected due to classification as Virus,Spam or high bulk ratio

This is a bounce back message that you receive when an email is classified as spam while sending out. If you feel that a genuine email is rejected as spam, you need to send the same email with the full headers and the content to our support team. That email in question will be reviewed manually.

530 5.7.0 Recipient address rejected: Authentication Required

This error comes when your sending mails to remote domain without using smtp authentication.

550 5.4.5 Recipient address rejected: Hourly domain sending quota exceeded

This is the error message that you get if your domain name exceeds the hourly quota set for the domain name. Here, the term ‘hour’ refers to the last 60 minutes.

550 5.4.6 Recipient address rejected: Hourly sending quota exceeded

This is the error message that you get if the user (that particular email address) exceeds the hourly quota set. Here, the term ‘hour’ refers to the last 60 minutes.

553 5.7.1 Sender address rejected: not owned by user user@domain.com

This is the error message that is received when you are trying to send an email as a different user.

554 5.7.1 : Recipient address rejected: USER IS SUSPENDED

This error comes if user is suspended in Control Panel.

522 5.7.1 : Recipient address rejected: Requested mail action aborted: exceeded storage allocation

This error comes if the user is overquota.

554 5.7.1 : Sender address rejected: Access denied

This error comes when the sender address is blocked on our server. Generally this is done if spam has originated from this user.

450 4.1.8 : Sender address rejected: Domain not found

Our inbound servers require that the hostname for the sender server should have valid MX or A records in order to accept emails from it. You need to contact the sending server’s email admin to add valid DNS records for his server.

450 4.7.1 Client host rejected: cannot find your reverse hostname

Our inbound servers require reverse hostname for the sender server to be present in order to accept the email. You need to contact the reverse hostname’s email admin to add the rDNS to into his server.

450 4.7.1 : Recipient address rejected: Policy Rejection- Quota Exceeded

This error comes from our incoming mail server if user is receiving excessive amounts of mails.

450 4.7.1 Recipient address rejected: Access denied

This occurs when the recipient address is invalid. i.e., not in form of user@domainname OR if the Recipient address is blocked on server.

451 4.3.5 Server configuration problem — try again later

451 4.7.1 Service unavailable — try again later;

This error most likely occurs if there is a configration error with our servers. If you encounter any of the above messages, please contact our support with the details.

452 4.5.3 Error: too many recipients

The error message is encountered when the user is exceeding the limit of more than 50 recipients in an email. The list of recipients is inclusive of To,Cc and Bcc. If you encounter the above error, reduce the number of recipients in the email and try again.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies

На чтение 5 мин. Просмотров 2.3k. Опубликовано 31.07.2019

Слишком часто сообщения об ошибках непонятны. Эта страница будет вашим руководством по кодовым почтовым серверам, если ваша электронная почта не отправляется. Если вы получили сообщение об ошибке типа «Не удалось отправить ваше сообщение. Ошибка 421», каков ваш следующий шаг? Пусть эта страница будет вашим руководством к тому, что делать дальше.

Содержание

  1. Коды ошибок SMTP: значение за цифрами
  2. Получил SMTP 550: постоянный сбой одного или нескольких получателей?
  3. Список кодов ошибок SMTP (с пояснениями)

Коды ошибок SMTP: значение за цифрами

Почтовый сервер ответит на каждый запрос клиента (например, вашей почтовой программы) кодом возврата. Этот код состоит из трех чисел.

Первый обычно указывает, принял ли сервер команду и может ли она ее обработать. Пять возможных значений:

  • 1 . Сервер принял команду, но пока не предпринимает никаких действий. Требуется подтверждающее сообщение. В настоящее время это не используется.
  • 2 . Сервер успешно выполнил задание.
  • 3 . Сервер понял запрос, но для его завершения требуется дополнительная информация.
  • 4 . На сервере произошла временная ошибка. Если команда повторяется без каких-либо изменений, она может быть выполнена. Почтовые серверы могут использовать такие временные сбои, чтобы держать ненадежных отправителей в страхе.
  • 5 . На сервере обнаружена ошибка.

Второй номер дает больше информации. Это шесть возможных значений:

  • 0 : произошла синтаксическая ошибка.
  • 1 . Обозначает информационный ответ, например, на запрос HELP.
  • 2 . Относится к статусу подключения.
  • 3 и 4 не указаны.
  • 5 . Относится к состоянию почтовой системы в целом и почтового сервера в частности.

Последний номер является еще более конкретным и показывает больше градаций статуса пересылки почты.

Получил SMTP 550: постоянный сбой одного или нескольких получателей?

Наиболее распространенный код ошибки SMTP при отправке электронной почты – 550.

Ошибка SMTP 550 – это общее сообщение об ошибке. Это означает, что письмо не может быть доставлено.

Ошибка доставки SMTP 550 происходит по разным причинам; хотя сам код ошибки 550 ничего не говорит о причине сбоя, многие SMTP-сервер содержат пояснительное сообщение с кодом ошибки.

Зачастую электронное письмо не может быть доставлено, поскольку оно было заблокировано как спам, либо путем анализа его содержимого, либо потому, что отправитель – или сеть отправителя – указан в качестве вероятного источника спама в черном списке DNS. Некоторые почтовые серверы также проверяют ссылки на вредоносные программы и возвращают ошибку 550. К SMTP-ошибкам 550 относятся следующие коды:

  • 550 5.7.1 . Служба недоступна: клиент [###] заблокирован с помощью ### (Exchange Server)
  • 550 5.7.1: сообщение отклонено как спам с помощью фильтрации содержимого (Exchange Server)
  • 550 Это сообщение было классифицировано как СПАМ и может быть не доставлено
  • 550 Высокая вероятность спама (Gmail)
  • 550 5.2.1 почта от отказавшегося спам-сайта
  • 550 Ваше сообщение было отклонено, так как было обнаружено, что вы отправляете спам (Отправка из Rackspace)
  • 550 Сообщение содержало небезопасный контент

Что ты можешь сделать? Если возможно, попробуйте связаться с получателем другими способами . Если сообщение об ошибке указывает на определенный черный список или фильтр спама, попробуйте связаться с администратором списка или фильтра . В противном случае вы всегда можете объяснить неудачную ситуацию своему провайдеру электронной почты . Они могут связаться со своим коллегой на приемной стороне и разобраться в ситуации.

Список кодов ошибок SMTP (с пояснениями)

Три числа ошибки SMTP дают нам подробный список кодов ответов сервера ESMTP/SMTP, как указано в RFC 821 и последующих расширениях:

  • 211 – сообщение о состоянии системы.
  • 214 . Далее следует справочное сообщение для читателя.
  • 220 – служба SMTP готова.
  • 221 . Служба закрывается.
  • 250 . Запрошенное действие выполнено и выполнено. Лучшее сообщение из всех них.
  • 251 . Получатель не является локальным для сервера, но сервер примет и перенаправит сообщение.
  • 252 . Получатель не может быть VRFYed, но сервер принимает сообщение и пытается доставить.
  • 354 – начинайте ввод сообщения и заканчивайте на. Это означает, что сервер готов принять само сообщение (после того, как вы сообщили ему, откуда оно и куда вы хотите отправиться).
  • 421 . Служба недоступна, и соединение будет закрыто.
  • 450 . Запрошенная команда не выполнена, поскольку почтовый ящик пользователя был недоступен (например, потому что он был заблокирован). Попробуйте позже.
  • 451 . Команда была прервана из-за ошибки сервера. Не твоя вина. Возможно, дайте знать администратору.
  • 452 . Команда была прервана, поскольку на сервере недостаточно системного хранилища.
  • 455 . Сервер не может обработать команду в данный момент.

Следующие сообщения об ошибках (500-504) обычно говорят вам, что ваш почтовый клиент неисправен или, чаще всего, что ваша электронная почта не может быть доставлена ​​по той или иной причине.

  • 500 . Сервер не смог распознать команду из-за синтаксической ошибки.
  • 501 . В аргументах команды обнаружена синтаксическая ошибка.
  • 502 . Эта команда не реализована.
  • 503 . Сервер обнаружил неверную последовательность команд.
  • 504 . Параметр команды не реализован.
  • 521 . Этот хост никогда не принимает почту; ответ фиктивного сервера.
  • 541 . Сообщение не может быть доставлено по политическим причинам – обычно это спам-фильтр. (Только некоторые SMTP-серверы возвращают этот код ошибки.)
  • 550 . Запрошенная команда не выполнена, поскольку почтовый ящик пользователя был недоступен (например, потому что он не был найден или команда была отклонена по соображениям политики).
  • 551 . Получатель не является локальным для сервера. Затем сервер выдает пробный адрес для переадресации.
  • 552 . Действие было прервано из-за превышения объема памяти.
  • 553 . Команда была прервана, поскольку имя почтового ящика неверно.
  • 554 . Транзакция не удалась. Во всем виновата погода.
  • 555 . Сервер не распознает формат адреса электронной почты, поэтому доставка невозможна.
  • 556 . Сообщение необходимо переслать, но принимающий сервер отклонит его.

  • #2

You intalled dovecot and exim with apt-get ? Why?

Try custombuild. Your /etc/exim.conf needs to be patched for use with dovecot.

http://help.directadmin.com/item.php?id=51

And you probably should remove what you installed with apt-get and install via custombuild.

  • #3

Re: custombuild…

Thank you very much for your help!

I’m a bit confused when it comes to installing and configuring applications on the server. I guess I should do most of the stuff from directadmin/custombuild/…

1. Ok, I uninstalled exim using apt-get remove exim…
2. I run ./build dovecot from /usr/local/directadmin/custombuild/
3. I run ./build exim from /usr/local/directadmin/custombuild/ . The result:

Code:

...
Trying to make exim...
/bin/sh: line 0: cd: build-Linux-i386: No such file or directory
make[1]: Entering directory `/usr/local/directadmin/custombuild/exim-4.69'

>>> Creating links to source files...
mkdir: cannot create directory `build-Linux-i386': File exists
*** It appears that ../scripts/MakeLinks was previously interrupted.
*** You need to remove the build directory, and then run 'make' again.
make[2]: Entering directory `/usr/local/directadmin/custombuild/exim-4.69/build-Linux-i386'
make[2]: *** No targets specified and no makefile found.  Stop.
make[2]: Leaving directory `/usr/local/directadmin/custombuild/exim-4.69/build-Linux-i386'
make[1]: *** [build-directory] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [go] Error 2
make[1]: Leaving directory `/usr/local/directadmin/custombuild/exim-4.69'
make: *** [go] Error 2
make: *** Waiting for unfinished jobs....

*** The make has failed, do you want to try to make again? (y,n):

4. Then I try this script How to compile exim from source, where make result in:

Code:

...
dbstuff.h:103:16: error: db.h: No such file or directory
In file included from exim.h:433,
                 from exim_dbmbuild.c:33:
dbstuff.h:529: error: expected specifier-qualifier-list before 'DB'
exim_dbmbuild.c: In function 'main':
exim_dbmbuild.c:150: error: 'DB' undeclared (first use in this function)
exim_dbmbuild.c:150: error: (Each undeclared identifier is reported only once
exim_dbmbuild.c:150: error: for each function it appears in.)
exim_dbmbuild.c:150: error: 'd' undeclared (first use in this function)
exim_dbmbuild.c:151: error: 'DBT' undeclared (first use in this function)
exim_dbmbuild.c:151: error: expected ';' before 'key'
exim_dbmbuild.c:213: error: 'DB_HASH' undeclared (first use in this function)
exim_dbmbuild.c:295: error: 'content' undeclared (first use in this function)
exim_dbmbuild.c:298: error: 'key' undeclared (first use in this function)
exim_dbmbuild.c:298: error: 'R_NOOVERWRITE' undeclared (first use in this function)
make[1]: *** [exim_dbmbuild.o] Error 1
make[1]: Leaving directory `/usr/local/directadmin/custombuild/exim-4.69/build-Linux-i386'
make: *** [go] Error 2

What should I do? :confused:

Regards,
//Mike

  • #4

Try this:

Code:

cd /usr/local/directadmin/custombuild
wget "http://files.directadmin.com/services/debian_5.0/da_exim-4.69.deb"
dpkg -i da_exim-4.69.deb
./build update
./build clean
./build dovecot d
wget -O /etc/exim.conf http://files.directadmin.com/services/exim.conf
wget -O /etc/exim.pl http://files.directadmin.com/services/exim.pl
patch -p0 < /usr/local/directadmin/custombuild/exim.conf.dovecot.patch
/etc/init.d/exim restart
/etc/init.d/dovecot restart

  • #5

Re: try this…

Okidok, I tried it. Dovecot and exim seem to be up and running. But I can’t send any mails and I can’t receive any new mails…

I get

Code:

ERROR:
Message not sent. Server replied:
Connection refused
111 Can't open SMTP stream.

in squirrel mail when trying to send mail…

However, I can send mails from shell using:

Code:

exim -v -odf root
This is a test message.
.

What next?

I appreciate very much your help!

//Mike

  • #7

Re: what’s next…

I ran:

Now I can receive emails… and send them! Great! Thanks a lot! :D

Previously I had problems with spam mails being sent from my server (that was the begining of everything… Now I can’t see any of those in my mail queue. However in /var/log/exim/rejectlog i see thousands of entries of the following:

That’s ok, no?

Can I apply SSL on smtp for outgoing mails?

Regards,
Mike

DirectAdmin Support


  • #8

Hello,

Are those domains yours, on this sever?
svju.msk.ru
action-page.de
etc..

If yes, your /etc/virtual/domains might be empty:
http://help.directadmin.com/item.php?id=113

Check over your entire /etc/virtual directory.
If you need to start the whole thing over, use this:
http://help.directadmin.com/item.php?id=66
however it will wipe out anything that you have (email accounts, password, etc..) so only run it if you don’t need the data.

If no.. if they’re not your domains, then those messages are fine and correct. Those message would be normal, since don’t want to relay them, that would be bad.

This is another checklist you can go through to ensure everything is as it should be:
http://help.directadmin.com/item.php?id=16

John

These days, an option to send mails is a basic requirement of any web application.

So popular applications like WordPress, Drupal etc. include a mail program called “PHPMailer” for sending mails.

The steps to setup PHPMailer may not be intuitive to many website owners and mistakes in configuration often cause “Smtp error: Failed to connect to server” error.

As part of our Support Services, we help website owners solve their technical issues. And, mail issue related with PHPMailer is an error that we see often .

In this article, we’ll see the top reasons for “Smtp error: Failed to connect” and how we fix them.

What is “Smtp error: Failed to connect to server” ?

Spammers often use php scripts that directly connect to remote servers and send spam mails.

To defend this, many Web Hosting providers block direct connection from websites to external mail servers.

In such servers, mails from website can be sent only via its own mail server (SMTP server) port, just as how Outlook or Windows Mail works.

PHPMailer is a mail application that works like a mail client and helps to send mail via SMTP server.

But, PHPMailer do not work out of the box. It can fail due to firewall restrictions on the server, wrong mail server name, port etc. and shows the error:

“Smtp error: Failed to connect to server”

And, depending on the response from the mail server, we’ve seen 2 variations of this error :

SMTP ERROR: Failed to connect to server: Connection refused (111)

or

SMTP ERROR: Failed to connect to server: Connection timed out (110)

What causes SMTP ERROR: Failed to connect to server ?

Here, let us discuss the top reasons for “SMTP ERROR: Failed to connect to server”.

1. SMTP restrictions on the server.

Servers restrict the programs that can directly connect to remote servers and send mail. Usually, only mail server, root user etc. allow SMTP connections.

For example, CPanel servers block access to external SMTP servers using the “SMTP Restrictions” option.

With this restriction, connection from PHPMailer to an external mail server do not work. The connection wait for some time and eventually die with the following error:

2018-10-12 04:12:37 SMTP ERROR: Failed to connect to server: Connection timed out (110)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Oops! Something went wrong and we couldn't send your message.Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

2. Firewall restrictions on the server

Mail servers accept or reject connections based on certain firewall policies.

All mail servers allow the connection from default mail port 25. Bu,t other mail ports like 465, 587 etc. will not be open in many servers.

On a server with mail port restrictions, when a website owner tries to send mail using an external smtp server on port 465, it ends up in error:

2018-08-28 10:33:12 Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): unable to connect to ssl://mail.xyz.com:465 (Connection refused)
2018-08-28 10:33:12 SMTP ERROR: Failed to connect to server: Connection refused (111)

Here, this “Connection Refused” error means that sending mail server refuses outbound connections on port 465 and is not able to connect to remote mail server.

3. Incorrect settings in PHPMailer

This SMTP error can also happen if the mail server name is incorrectly set (with additional white space) in PHPMailer configuration. Then, web form tries to connect to an invalid name and fails.

4. DNS failures

For the PHPMailer to work properly, the mail server specified in its configuration should have proper dns records. When dns do not work on the server, a look up from the server shows wrong IP address or no IP address for the mail server. Again, that causes mail to fail with SMTP error.

How to fix SMTP Error: Failed to connect to server

For mails to work with PHPMailer, both sending and receiving server has to accept connections.

Our Support Engineers primarily checks the connection between mail servers and find whether it is an incoming or outgoing block.

Then, to fix the mail error, we make changes on the server that includes the following :

  1. Modify the firewall rules on the server to allow outbound connections on ports like 465.
  2. Modify the SMTP restrictions on the server. Then, add particular website user to the list of users who can make outbound SMTP connections.
  3. Edit PHPMailer settings like Host, Port etc.
  4. Correct DNS resolution for mail server.

Conclusion

“SMTP ERROR: Failed to connect to server” mainly happens because of mail server connectivity issues, wrong port settings etc. Here, we have discussed the causes that our Support Engineers often see in servers and how we fix them.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = «owonCMyG5nEQ0aD71QM»;

Понравилась статья? Поделить с друзьями:
  • Error when initializing oci environment
  • Error when getting information for file input output error
  • Error when entering lobby crab game
  • Error when creating end request 400 неверный тип амд message code 4000
  • Error when communicating with the native messaging host такском