When you send an email using CDOSYS you get the following error

error ‘8004020f’


The error code is returned by CDOSYS when the email is rejected by the mail server.


  • Make sure the ‘From’ email address is set correctly and is an email address etup on your account
  • Check that you have set the correct SMTP server.
  • Check that your hosting plan includes SMTP
  • If you use your ISPs SMTP server, check that they do not limit the use of their services.
  • Try using a SendUsing value of 1 (pickup) instead of 2 (port). E.g. the following line:
    .Item(cdoSendUsingMethod) = cdoSendUsingPort

    would become;

    .Item(cdoSendUsingMethod) = cdoSendUsingPickup