Skip to end of metadata
Go to start of metadata
CiviCRM Documentation

This page refers to outdated version of CiviCRM. Check current version of documentation.

Error: Invalid response code received from server - when trying to send email to contacts.

If you get an error of "Invalid response code received from server" when trying to send email(s) to CiviCRM contact(s), OR after submitting the Confirmation page when making an online contribution, OR after submitting the Confirmation page when registering for an event:

  • This error generally means that your SMTP server/provider is refusing to "relay" the email you are trying to send because it doesn't recognize the Sender as a valid local SMTP mail account.
    • When using the "built-in" Send Email to Contact(s) function, the email address of the logged-in user is set as the FROM address. Your SMTP provider MAY require that this be a local mail account.
    • When the error is associated w/ contributions and or event registration - the problem is related to sending the receipt. Each Online Contribution page and Event Registration page allows you to configure the FROM Email Address used for the receipt. Your SMTP provider MAY require that this be a local mail account.
  • If you get this message when sending to a great number of Contacts, but are able to send okay to a smaller number, then your SMTP server may be blocking the email because it looks like spam.  There is not much that can be done about this.

NOTE: This error is generally displayed in a big "dump" on the page like this:

error

Array

(

    \[callback\] => Array

        (

            \[0\] => CRM_Core_Error

            \[1\] => handle

        )


    \[code\] =>

    \[message\] => Invalid response code received from server

    \[mode\] => 16

    \[debug_info\] =>

    \[type\] => pear_error

    \[user_info\] =>

    \[to_string\] => \[pear_error: message="Invalid response code received from

server" code=0 mode=callback callback=CRM_Core_Error:

:handle prefix=""

info=""\]

)
Labels
  • None
  1. Nov 17, 2008

    I have found another scenario where this error can occur: if the recipient domain has no valid MX record.  You can investigate what's happening by setting $_debug to true in civicrm/packages/Net/SMTP.php . Here's an example, with addresses disguised:

    DEBUG: Send: MAIL FROM:<me@valid.domain>
    DEBUG: Recv: 250 2.1.0 Ok
    DEBUG: Send: RCPT TO:<them@invalid.domain>
    DEBUG: Recv: 450 4.1.2 <them@invalid.domain>: Recipient address rejected: Domain not found

    The problem is that Civi aborts the whole mailout at this point so if you're sending to multiple contacts, it will fall over at the first invalid domain. This is with Civi 1.8.11248, mail server is Postfix 2.3.3 .


Creative Commons License
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-Share Alike 3.0 United States Licence.